Monday, November 2, 2009

[Rails] Re: Redundant require lib statements

On Nov 2, 1:59 pm, Fernando Perez <rails-mailing-l...@andreas-s.net>
wrote:
> Hi,
>
> Let's say in Model1 I require 'net/http', and in Model9 I also require
> 'net/http' because I forgot it was already required in Mode1, will that
> cause a problem?
>
Nope. The second require will be ignored (note that ruby just looks at
the string you pass require - you could force it to load net/http a
second time by doing require '/usr/local/lib/ruby/1.8/net/
http' (assuming that is where those files were on disk)).

Fred
> Should I redundantly require libs? Should I put require statements in a
> common place? What's the consensus on that?


--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate