i am struggling a bit with all of them .. could someone be so nice a describe me the exact differences, pros & cons of all of them ... thx a lot! -- 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 wrote about include/require in my blog a while back ... http://francis.blog-city.com/extendingmixin_ruby_classes_with_modules.htm I''ve never used require_dependency ... HTH Michal Gabrukiewicz wrote:> i am struggling a bit with all of them .. could someone be so nice a > describe me the exact differences, pros & cons of all of them ... thx a > lot! > -- > 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 Nov 29, 2007, at 12:52 PM, ghoti wrote:> I wrote about include/require in my blog a while back ... > > http://francis.blog-city.com/extendingmixin_ruby_classes_with_modules.htm > > I''ve never used require_dependency ...That''s internal Rails stuff. More or less it means "load this library and monitor the constants it defines". If your file follows Rails conventions it is picked up automatically and class reloading works out of the box. If the file does not follow them, for example "application.rb" would be called "application_controller.rb" if it did, you can still load it and get the benefits of automatic class reloading via require_dependency. I don''t know whether is meant for public consumption though, since it is not documented. Just follow Rails file naming conventions and let Dependencies do its job. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 Nov 29, 2007, at 5:52 AM, ghoti wrote:> > I wrote about include/require in my blog a while back ... > > http://francis.blog-city.com/extendingmixin_ruby_classes_with_modules.htmNice simple explanation. Thanks, By the way, and totally off-topic, to anybody wondering about the name "ghoti," if I recall correctly, it''s an alternate "spelling" of the word fish, using the gh from laugh, the o from women, an the ti from nation. It was constructed by somebody (I don''t remember who) a long long time ago complaining about spelling in English. I hadn''t thought of it in many years until I saw it here. :-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanks for the detailed explanation ... could you briefly outline the "naming conventions" -- 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 Nov 29, 2007, at 5:24 PM, Michal Gabrukiewicz wrote:> thanks for the detailed explanation ... > could you briefly outline the "naming conventions"Sure, take the fully-qualified name of the class you want Rails to autoload and run this: $ script/console Loading development environment. >> "FooBar::Woo".underscore + ''.rb'' => "foo_bar/woo.rb" That says that if the class FooBar::Woo is defined in a file named "foo_bar/woo.rb" living inmediately below some standard application directory like app/controllers Rails will find the file and load it for you automatically. For example, if you define the User class in the file user.rb under app/models you don''t need to require ''user''. Note you would in regular Ruby. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 see... but this applies only to the contents within the "app" directory doesnt it? -- 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 Nov 29, 2007, at 7:16 PM, Michal Gabrukiewicz wrote:> i see... but this applies only to the contents within the "app" > directory doesnt it?Not really. It applies to the contents listed in Dependencies.load_path, which in addition to app subdirs include lib and a few others. Check it out in the console. That list may be further customised via config.load_paths in environment.rb. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanks.. great help!! will try to use that knowledge.... -- 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 -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Am I misunderstanding "require_dependency"?
- Is require_dependency supposed to be a public API?
- Couldn't reload a module when it's changed. Tried :require_dependency, :watchable_dirs, :unloadable
- aliasing, require_dependency and require
- Requiring /lib files in a cross-platform way.