Sunday, 13 May 2007

Rails plugins : group_by(environment)

If your vendor/plugins directory gets overcrowded and you use some test/development-specific plugins, here is a quick way to clean up your source tree :

Step 1: split the vendor/plugins directory

Create two directories : vendor/plugins-development and vendor/plugins-test, and move your plugins accordingly :

Step 2: tell Rails where to find the moved plugins

In config/environment/development.rb add this line:
1
2
3

config.plugin_paths.push('vendor/plugins-development' ).uniq!
, and in config/environment/test.rb add:
1
2
3

config.plugin_paths.push('vendor/plugins-test' ).uniq!
And that's it.

0 comments: