Zhoran Tvalve
2008-Nov-18 15:04 UTC
Code changes are ignored due to code minor ver. were cached
Hi there! I study Ruby on Rails and met a problem. I placed a class definition code for class which is NOT a Model into separate file, assume MyToolClass.rb Then I started working on controller code and required ''MyToolClass'' While working on controller code I also corrected some code in MyToolClass.rb, but it seemed, that changes in MyTooolClass.rb were ignored by Rails until I had restarted Mongrel. Q#1: Please write to me how can I tell Rails to reread source files those were changed after last use. Q#:2 Where to place files like MyToolclass.rb, which are nither Model, nor Controller? Thank you for your attention. -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Nov-18 16:03 UTC
Re: Code changes are ignored due to code minor ver. were cached
On Nov 18, 3:04 pm, Zhoran Tvalve <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi there! > I study Ruby on Rails and met a problem. > > I placed a class definition code for class which is NOT a Model into > separate file, assume MyToolClass.rb > > Then I started working on controller code and required ''MyToolClass'' >use require_dependency instead of require. Fred> While working on controller code I also corrected some code in > MyToolClass.rb, but it seemed, that changes in MyTooolClass.rb were > ignored by Rails until I had restarted Mongrel. > > Q#1: Please write to me how can I tell Rails to reread source files > those were changed after last use. > > Q#:2 Where to place files like MyToolclass.rb, which are nither Model, > nor Controller? > > Thank you for your attention. > -- > 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 -~----------~----~----~----~------~----~------~--~---
Jeff
2008-Nov-18 16:54 UTC
Re: Code changes are ignored due to code minor ver. were cached
On Nov 18, 10:03 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 18, 3:04 pm, Zhoran Tvalve <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Hi there! > > I study Ruby on Rails and met a problem. > > > I placed a class definition code for class which is NOT a Model into > > separate file, assume MyToolClass.rb > > > Then I started working on controller code and required ''MyToolClass'' > > use require_dependency instead of require. > > FredBut if the file name follows conventions (so a class named MyToolClass would go in a file named app/models/my_tool_class.rb or lib/ my_tool_class.rb), then no require or require_dependency should be needed and code changes will be automatically reloaded in development mode. If you''re not following naming conventions, then do as Fred suggests :-) Jeff www.purpleworkshops.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 -~----------~----~----~----~------~----~------~--~---
Zhoran Tvalve
2008-Nov-20 10:14 UTC
Re: Code changes are ignored due to code minor ver. were cached
Jeff Cohen wrote:> On Nov 18, 10:03�am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> >> use require_dependency instead of require. >> >> Fred > > But if the file name follows conventions (so a class named MyToolClass > would go in a file named app/models/my_tool_class.rb or lib/ > my_tool_class.rb), then no require or require_dependency should be > needed and code changes will be automatically reloaded in development > mode. > > If you''re not following naming conventions, then do as Fred > suggests :-) > > Jeff > > www.purpleworkshops.comMany thanks, guys! I put each my class into it''s own file in app''s lib directory following naming conventions and Voila! After that every change in these files are incorporated immediately without require or require_dependency calls. That''s great! -- 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 -~----------~----~----~----~------~----~------~--~---