On Sat, Jan 30, 2010 at 1:05 PM, Xavier N. [email protected] wrote:
On Sat, Jan 30, 2010 at 7:21 PM, Josh C. [email protected] wrote:
If they installed your gem using rubygems they will load rubygems.
They can’t load your library otherwise in the first place. Executables
may be a different story.
The way dependencies are available in your client’s machine is not
your business! I gave several examples where rubygems may not be
available at runtime.
On Sat, Jan 30, 2010 at 1:31 PM, Intransition [email protected]
wrote:
end
end
You should simply not have to use require ‘rubygems’ in your code at
all.
Perhaps I am confused, is there a problem with this code?:
begin
require ‘mechanize’
rescue LoadError
require ‘rubygems’
require ‘mechanize’
end
From here, it appears that if you have your own way of managing gems,
then
rubygems will not be loaded, because you will not experience a
LoadError.
Thus it satisfies that I don’t tell you how to load your gems, while for
the
vast majority of people, it simply works the way they want / expect it
to.
If this is not acceptable, please be explicit in explaining why (perhaps
an
example of how it would require rubygems if you are using a different
manager).
If it is acceptable, but my code earlier is not, please explain the
difference.
If it is acceptable, and my code earlier is, then perhaps Ruby should
behave
this way by default, since it would make life easier for both rubygems
users
(because they don’t have to tell their code to require rubygems) and
non-rubygems users (because the gems they get will not have required
rubygems). In this case, the language would encourage the proper
behaviour,
because there would be no need to require rubygems (and thus no hurdles
for
people who do not want it loaded).
On Sat, Jan 30, 2010 at 2:32 PM, Shot (Piotr S.)
[email protected]wrote:
— Shot
I don’t have 1.9, but this sounds like it requires rubygems
automatically,
which seems to contradict what several people earlier have said we
should
do. For example, the original post quotes “The system I use to manage my
$LOAD_PATH is not your library/app/tests concern.” If I understand what
you
have said, it sounds like the language has done what they are saying
that we
should not do.