On Mon, Aug 27, 2007 at 09:50:37AM -0700, Trevor Rowe wrote:
> I too am annoyed by having to restart my server frequently when editing
> plugin assets.  You symlink suggestion seems like it would work, but I
> have a question.
> 
> Doesn't it just end up copying all the plugin asset files on-top of
> themselves at server start?  If so, wouldn't it be better to symlink and
> then somehow disable the whole copy process all-together?

I hadn't really considered that.  It wouldn't be a problem if it did,
IMHO, but let's look at what it really does.
See engines/lib/init.rb, at the bottom of the file in the method
mirror_files_from:

    source_files.each do |file|
      begin
        target = File.join(destination, file.gsub(source, ''))
        unless File.exist?(target) && FileUtils.identical?(file, target)
          FileUtils.cp(file, target)
        end 
      rescue Exception => e
        raise "Could not copy #{file} to #{target}: \n" + e 
      end
    end  

So you see, it will never actually copy the file because it is identical
to itself.  (this method is called in engines/lib/engines/plugin.rb by
mirror_public_assets)

Regards,
Peter Bex
Solide ICT - http://www.solide-ict.nl
_______________________________________________
Engine-Users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

Reply via email to