MasterView users,<br><br>I have just added an auto copy feature to the MasterView trunk (which will be in the next release). I clipped this out of the configuration document, let me know if anything is unclear or if there is anything critical missing in this feature.
<br><br>----------------<br><br>config.auto_copy_file_entries controls what MasterView will automatically copy<br><br>Locations of files that MasterView will autocopy to a runtime location
This autocopy feature makes it easy to have prototypes that display properly for
WYSIWYG editing and design, using files (images, stylesheets, and javascript) which are not
in the standard Rails locations but are automatically copied to proper place for runtime.
This is commonly used in conjunction with template_src_dir_path (which changes the
location of the source MasterView templates). Developers can have their templates in a non-standard
location along with images, stylesheets, and javascript, and then still have everything copied to
the proper runtime locations when Rails is fired up. <br><br>In debug mode, timestamps are checked on every request,
in production mode, copy is done only on startup.
<br><br>
Each entry is a hash that needs to contain
<ul><li>:source => 'path to source folder' # absolute or relative to RAILS_ROOT</li><li>:destination => 'path to place to copy to' # absolute or relative to RAILS_ROOT</li></ul>
and can optionally have a file extension filter
<ul><li>:extensions => [:gif, :GIF, :jpg, :JPG] # limit files copied to this array of extensions, case sensitive</li></ul><br>Default: [] # nothing will be auto copied<br><br>
Example usage showing three paths added to be auto copied:<br>
config.auto_copy_file_entries << { :source => 'images', :destination => 'public/images' }<br>
config.auto_copy_file_entries << { :source => 'scripts',
:destination => 'public/javascripts', :extensions => [:js, :JS] }
# only copy js files<br>
config.auto_copy_file_entries << { :source => 'css', :destination => 'public/stylesheets' }<br><br>(These examples are also in the latest example settings.rb config file which is installed when using script/generate masterview_plugin)
<br><br><br>Thanks,<br><br>Jeff<br>