public
Description: Intelligent asset management for Rails plugins.
Homepage: http://matthewbass.com/2008/11/17/smart-asset-management-for-rails-plugins/
Clone URL: git://github.com/pelargir/asset_copier.git
Matthew (author)
Sat Aug 22 06:07:08 -0700 2009
commit  fb7c57830c366bca5109efd6d05f4146bfe6b43f
tree    8d8c002f341314b33e1cb8aa50fd2d0256e2f0cb
parent  e32910ead409eadcc1105d37125cec2391d31bf0
name age message
file .gitignore Thu Oct 30 07:47:08 -0700 2008 initial commit [Matthew Bass]
file CHANGELOG Thu Oct 30 07:47:08 -0700 2008 initial commit [Matthew Bass]
file MIT-LICENSE Thu Oct 30 07:47:08 -0700 2008 initial commit [Matthew Bass]
file README Sat Nov 08 09:44:43 -0800 2008 updated readme [Matthew Bass]
file Rakefile Fri Oct 31 07:15:06 -0700 2008 renamed to generator [Matthew Bass]
file TODO Mon Nov 03 09:08:02 -0800 2008 added file comparisons and production warnings [Matthew Bass]
file USAGE Fri Oct 31 07:05:43 -0700 2008 first pass at generator [Matthew Bass]
file asset_copier_generator.gemspec Sat Aug 22 06:07:08 -0700 2009 updated gemspec [Matthew]
file asset_copier_generator.rb Mon Nov 03 19:01:28 -0800 2008 stuck asset_copier.rb in its own namespace [Matthew Bass]
directory templates/ Fri Dec 05 08:27:46 -0800 2008 fixed regular expression for source control dirs [Matthew Bass]
README
= asset_copier_generator

Intelligent asset management for Rails plugins.

== Installation
 
Install the gem directly:

  sudo gem install pelargir-asset_copier --source=http://gems.github.com  

Or clone the project, build the gem, and install:

  git clone git://github.com/pelargir/asset_copier.git
  gem build asset_copier_generator.gemspec
  sudo gem install asset_copier_generator

== Apply to Target Plugin

asset_copier_generator will copy the necessary files into a target plugin
to enable intelligent asset management. You should then check these files in
to source control. The generated files become a part of your plugin.

To install the files in your plugin, first ensure that your plugin is installed
or symlinked from an existing Rails app. From the root of that Rails app, run:

  script/generate asset_copier plugin_name
  
Where "plugin_name" is the name of the plugin you want to install into. The
appropriate files will be copied into your plugin. Now, to copy assets
from your plugin into your Rails app, run:

  rake plugin_name:install

Your users can run this same Rake task any time they want to update files
in their Rails app to reflect the assets needed by your plugin.

== Usage

Once applied to a target plugin, files within the /files directory of that
plugin will be copied into RAILS_ROOT whenever the installation task is run.

Files will also be copied every time the Rails server is started if the project
is running in development mode. (Projects running in production mode will instead
receive a warning in the log that one or more files are missing. No files
will automatically be copied.)

What if you remove a file from your plugin at some future point? Simply add
the file path to deleted_files. The next time the Rails server is started
or the install task is run, a warning will print in the log informing the
user that the file has been removed from the plugin and can also safely
be removed from their Rails project.

== Resources

Repository: http://github.com/pelargir/asset_copier
Blog: http://matthewbass.com
Author: Matthew Bass

Extraction work sponsored by Terralien