> In revision 5720, NZKoz checked in some stuff that is supposed to use
> config.plugins for loading plugin s in the right order. I think he
> intended it to keep working the way it is if config.plugins is not set,
> but at least for me, no plugins are being loaded at all with this
> change.
Following up on this, I can't replicate Martin's problem. Here are the
steps I took to try:
1. create new rails application
$ cd /tmp
$ rails test_plugin_loading
< ... rails project creation output ... >
$ cd test_plugin_loading
2. check out the version of Rails with patches from #6851 and #6842 installed
$ svn co -r 5720 http://dev.rubyonrails.org/svn/rails/trunk vendor/rails
3. create some sample plugins
$ mkdir vendor/plugins/plugin_a
$ mkdir vendor/plugins/plugin_a/lib
$ echo "puts 'loading plugin a'" > vendor/plugins/plugin_a/init.rb
$ mkdir vendor/plugins/plugin_b
$ echo "puts 'loading plugin b'" > vendor/plugins/plugin_b/init.rb
4. load up script/console
$ script/console
Loading development environment.
loading plugin A
loading plugin B
>> puts $LOAD_PATH
< ... snipped to show the relevant parts ... >
script/../config/../config/../components
script/../config/../config/../config
script/../config/../config/../lib
script/../config/../config/../vendor/plugins/plugin_a/lib/
script/../config/../config/../vendor
/private/tmp/test_loading_plugins/vendor/rails/railties/builtin/rails_info/
script/../config/../config/../vendor/rails/railties
script/../config/../config/../vendor/rails/railties/lib
< ... etc ... >
... as you'd expect, both plugins are loaded, and plugin_a/lib
appears in the load path. Editing config/environment.rb to include
"config.plugins = ", and as expected, no plugins load:
>> exit
$ script/console
Loading development environment.
>>
In this case, no plugins have been loaded, and accordinly
vendor/plugins/plugin_a/lib does NOT appear in the $LOAD_PATH.
My only conclusion here is that the patch works fine, and that the
setup Martin was using somehow relied on the previously-broken
behaviour of having all plugin lib directories in the $LOAD_PATH
before any plugins are actually loaded. I'd suggest that Martin makes
use of config.plugins to fix his application.
It's worth noting that #6851 doesn't affect this issue - can we reapply that?