Is there a way to reload everything on each request. I''m working with a lot of lib and vendor/plugin files, and in development mode i''d like to have all of those reloaded. I used to have a couple of methods that worked in rails < 2.1 but they are no longer working. -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
On Jun 10, 5:18 am, Alex Moore <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Is there a way to reload everything on each request. I''m working with a > lot of lib and vendor/plugin files, and in development mode i''d like to > have all of those reloaded. > > I used to have a couple of methods that worked in rails < 2.1 but they > are no longer working.I wrote up what I do at http://www.spacevatican.org/2008/5/28/reload-me-reload-me-not Fred> -- > Posted viahttp://www.ruby-forum.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thankyou very much! I''ll be trying that out in the morning!> On Jun 10, 5:18�am, Alex Moore <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Is there a way to reload everything on each request. �I''m working with a >> lot of lib and vendor/plugin files, and in development mode i''d like to >> have all of those reloaded. >> >> I used to have a couple of methods that worked in rails < 2.1 but they >> are no longer working. > > I wrote up what I do at > http://www.spacevatican.org/2008/5/28/reload-me-reload-me-not > > Fred-- Posted via http://www.ruby-forum.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Whatever I do I still can not reload the plugin, the plugin is definitely not in the load once paths. My init.rb just contains 4 requires but nothing besides that. I''ve googled, nobody else seems to be having this issue. -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
config.reload_plugins = true; deletes all of the Dependencies.load_paths, but the plugin still doesn''t reload -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
I ran into the same problem; turned out that I also had to add the module which contains my plugin''s classes to ActiveSupport::Dependencies.explicitly_unloadable_constants So if you have your plugin structured like this init.rb lib/myplugin.rb lib/myplugin/*.rb you should add the following line to your init.rb ActiveSupport::Dependencies.explicitly_unloadable_constants ''Myplugin'' and then declare a module (or a class) called Myplugin in lib/ myplugin.rb (otherwise Rails would give me errors about expecting this file to declare a class with that name) On Jul 24, 2:36 am, Alex Moore <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> config.reload_plugins = true; deletes all of the > Dependencies.load_paths, but the plugin still doesn''t reload > -- > Posted viahttp://www.ruby-forum.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ingmar: Thankyou for your reply, I still haven''t managed to resolve the issue My init.rb file contains the following: require ''activeext.rb'' require ''activeext_model.rb'' require ''activeext_controller.rb'' require ''activeext_view.rb'' Dependencies.explicitly_unloadable_constants = ''ActiveExt'' Dependencies.load_once_paths.delete(File.expand_path(File.dirname(__FILE__))+''/lib'' For some reason scoping Dependencies in the ActiveSupport module doesn''t work. Also after I add the explicitly_unloadable_constants, the module is no longer available in the controller. (I suppose this could be because the plugin has the same name as the module? Ingmar wrote:> I ran into the same problem; turned out that I also had to add the > module which contains my plugin''s classes to > ActiveSupport::Dependencies.explicitly_unloadable_constants > > So if you have your plugin structured like this > > init.rb > lib/myplugin.rb > lib/myplugin/*.rb > > you should add the following line to your init.rb > > ActiveSupport::Dependencies.explicitly_unloadable_constants > ''Myplugin'' > > and then declare a module (or a class) called Myplugin in lib/ > myplugin.rb (otherwise Rails would give me errors about expecting this > file to declare a class with that name) > > On Jul 24, 2:36�am, Alex Moore <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- Posted via http://www.ruby-forum.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 9 Sep 2008, at 00:20, Alex Moore <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Ingmar: Thankyou for your reply, I still haven''t managed to resolve > the > issue > > My init.rb file contains the following: > require ''activeext.rb'' > require ''activeext_model.rb'' > require ''activeext_controller.rb'' > require ''activeext_view.rb'' > > Dependencies.explicitly_unloadable_constants = ''ActiveExt'' > Dependencies. > load_once_paths.delete(File.expand_path(File.dirname(__FILE__))+''/lib'' > > For some reason scoping Dependencies in the ActiveSupport module > doesn''t > work. Also after I add the explicitly_unloadable_constants, the > module > is no longer available in the controller. (I suppose this could be > because the plugin has the same name as the module? >Dependencies is only inside the activesupport namespace in edge. Even if a plugin is marked as reloadable it''s init.rb won''t get reloaded as far as I know - it just controls whether the constants are removed after requests Fred> > > > Ingmar wrote: >> I ran into the same problem; turned out that I also had to add the >> module which contains my plugin''s classes to >> ActiveSupport::Dependencies.explicitly_unloadable_constants >> >> So if you have your plugin structured like this >> >> init.rb >> lib/myplugin.rb >> lib/myplugin/*.rb >> >> you should add the following line to your init.rb >> >> ActiveSupport::Dependencies.explicitly_unloadable_constants >> ''Myplugin'' >> >> and then declare a module (or a class) called Myplugin in lib/ >> myplugin.rb (otherwise Rails would give me errors about expecting >> this >> file to declare a class with that name) >> >> On Jul 24, 2:36╴am, Alex Moore <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > -- > Posted via http://www.ruby-forum.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alex, It might be a name-convention issue... If your module/class is called ''ActiveExt'' then the corresponding .rb file should be named active_ext.rb (without the underline, it corresponds to the class ''Activeext'' without the capital E) Try to either rename your model or your files accordingly. Make sure that you''re running the latest version of Rails (I''m using 2.1.1 atm) which encourages you to use ActiveSupport::Dependencies rather than just Dependencies btw. You may also create a new project and try it with a non-brainer-plugin first, like a class that only has one method throwing a certain string. You should be able to access that class from within your controller without adding another ''require'' command (the one from init.rb should be sufficient). One more thing (sorry for the verbose reply) - if you''re adding functionality to some of Rails'' modules and classes like for example ActiveRecord, you might be out of luck. As far as I understand it, these are generally not being reloaded although there may still be some tricks I don''t know of. On Sep 9, 1:20 am, Alex Moore <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Ingmar: Thankyou for your reply, I still haven''t managed to resolve the > issue > > My init.rb file contains the following: > require ''activeext.rb'' > require ''activeext_model.rb'' > require ''activeext_controller.rb'' > require ''activeext_view.rb'' > > Dependencies.explicitly_unloadable_constants = ''ActiveExt'' > Dependencies.load_once_paths.delete(File.expand_path(File.dirname(__FILE__))+''/lib'' > > For some reason scoping Dependencies in the ActiveSupport module doesn''t > work. Also after I add the explicitly_unloadable_constants, the module > is no longer available in the controller. (I suppose this could be > because the plugin has the same name as the module? >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---