Thanks Simon Macneall,
It worked!!
I hope you mean ActiveSupport::Dependencies by Dependencies otherwise
I get an error `const_missing':NameError: uninitialized constant
Rails::Initializer::Dependencies.
I first tried only to write

ActiveSupport::Dependencies.load_once_paths.delete RAILS_ROOT + '/
vendor/plugins/my_plugin/lib'

but that didn't work out, so I changed it too -

ActiveSupport::Dependencies.explicitly_unloadable_constants <<
'MyPlugin'
ActiveSupport::Dependencies.load_once_paths.delete RAILS_ROOT + '/
vendor/plugins/my_plugin/lib'

- thanks for your answer.

On Jul 4, 11:31 am, "Simon Macneall" <[email protected]> wrote:
> I have this in my development.rb file, which I set up when I was making  
> some changes to a thirdparty plugin and got sick of the constant  
> restarting.
>
> # this forces the Ezgraphix plugin to be reloaded each time - to  
> facilitate 'fixing' and updating it
> Dependencies.explicitly_unloadable_constants << 'Ezgraphix'
> ["ezgraphix"].each do |plugin_name|
>    reloadable_path = RAILS_ROOT + "/vendor/plugins/#{plugin_name}/lib"
>    Dependencies.load_once_paths.delete(reloadable_path)
> end
>
> Cheers
> Simon
>
> On Sat, 04 Jul 2009 14:24:46 +0800, Vikrant <[email protected]> wrote:
>
> > No, you didn't understand.
> > What I'm telling is, while I'm coding in "development" mode, if I
> > change something in "app/controllers/application_controller.rb",
> > changes appear instantly. But if I change something in "vendor/plugins/
> > my_plugin/lib/example.rb", I need to restart the server for changes to
> > take effect. (even in "development" mode).
> > In other words, applications files get reloaded on every request,
> > while plugin files load only once and stay in memory.
> > How can I make sure that plugin files also reload with every request?
>
> > - thanks
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to