Hi, I see references to using config.plugins like so: config.plugins = [ ''plugin_dependencies'', "*" ] in the engines and appable plugins worlds (et al). Reading the initializer code I just can''t see how this would work, and in fact it doesn''t for me (nor does my lame hack [1]),. Can anyone tell me how I might tell the initializer to load plugin A, then B, then everything else? Thanks, pt. [1] config.plugins = [ ''plugin_dependencies'' ] + Rails::Initializer.new(config).send(:find_plugins, "./vendor/plugins").collect do |path| path.gsub!(/^.+\/(.+)$/, ''\1'') end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Parker > I see references to using config.plugins like so: I don''t know about the Engine way to handle this, but in standard Rails I use config.plugin_paths to tell Rails where to find extra plugins. For example, I move all my development-only plugins to a separate directory vendor/plugins-development , and I link to it by adding config.plugin_paths.push(''vendor/plugins-development'' ).uniq! in development.rb more details here: http://blog.ravet.com/2007/05/rails-plugins-sortbyenvironment.html Alain Ravet -------- http://blog.ravet.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The engines plugin overrides the default Rails initializer code to achieve this. You can see the code in the following files: http://svn.rails-engines.org/plugins/engines/lib/engines.rb http://svn.rails-engines.org/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb In the "vanilla" rails, there''s no way to say "load A, then B, then everything else in any order", which is why I had to implement it myself. Hooking into the initializer is tricky from a plugin (since you''re overriding the very mechanism that''s loading your changes), but if you spend some time looking at the engines plugin code you should be able to figure out which parts I needed to change. James On May 15, 2:45 pm, "Parker Thompson" <park...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I see references to using config.plugins like so: > > config.plugins = [ > ''plugin_dependencies'', > "*" > ] > > in the engines and appable plugins worlds (et al). Reading the initializer > code I just can''t see how this would work, and in fact it doesn''t for me > (nor does my lame hack [1]),. Can anyone tell me how I might tell the > initializer to load plugin A, then B, then everything else? > > Thanks, > > pt. > > [1] > > config.plugins = [ > ''plugin_dependencies'' > ] + > Rails::Initializer.new(config).send(:find_plugins, > "./vendor/plugins").collect do |path| > path.gsub!(/^.+\/(.+)$/, ''\1'') > end--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---