tirsen/activemessaging

Loading sequence problem

GoogleCodeExporter opened this issue · 2 comments

What steps will reproduce the problem?
1. Plug-in loads all processors during initialization. If processors refer to 
the classes that use any 
of the plug-ins that should be loaded after activemessagingit will cause 
exception.


Original issue reported on code.google.com by alex.por...@gmail.com on 1 May 2008 at 7:21

Attachments:

by removing the load_processors from the reload method, you won't get processors
reloading in dev mode, so you have sacrificed that part of a13g functionality.

Couldn't the answer to this to order your plugin loading in your rails env 
config (in
rails 2.0.+ anyway)?

Original comment by kooks...@gmail.com on 1 May 2008 at 8:01

Plugin ordering works in 1.2.6 as well. The only problem is that you have to 
specify all the plugins.  You don't 
have any of the nice syntax sugar 2.0 gives you.

This is what I do:
  plugins = Dir["#{RAILS_ROOT}/vendor/plugins/*"].collect {|dir| File.basename(dir) }
  plugins.delete("rails_rcov")  # remove rails_rcov since it's not really a plugin that can be loaded
  plugins.insert(0, plugins.delete("gemsonrails")) # move gemsonrails plugin to the head of the class so all the 
vendored gems are required first
  config.plugins = plugins


Original comment by aps...@gmail.com on 9 Jun 2008 at 10:58