[Rubygems-developers] Release 0.8.0? (Was: Rubygems update script
updated on rubyforge)
batsman.geo at yahoo.com
Sun Sep 12 05:57:21 EDT 2004
On Sun, Sep 12, 2004 at 12:01:23PM +1000, Gavin Sinclair wrote:
> A possible alternative is to change the way require_gem works, in line
> with what Austin has suggested on ruby-core. That is, using the
> 'require' path instead of the gem name. For instance:
> require_gem 'diff/lcs' # instead of require_gem 'diff-lcs'
That's what I had in mind when I wrote that :-)
I believe the current scheme e.g. require 'diff-lcs' (require_gem
"foo" just modifies $: by default, nothing is loaded unless there's an
auto_require) doesn't offer any significant gains when compared to a
simple extension of require (named require_gem) to allow version
specification (e.g. require 'diff/lcs' or require_gem 'diff/lcs',
"> 1.0.1"). As I see it, require 'diff/lcs' should be preferred unless
you absolutely need a specific version, in which case require_gem would
Also, having an unqualified require_gem makes little sense: you're
making the sw. dependent on RubyGems without getting a specific version
> Then you can have:
> require 'diff/lcs' # don't care about version and
> # want to interoperate
> require_gem 'diff/lcs', '> 1.0.1' # do care about version
> require_gem 'diff/lcs/array', '> 1.0.1' # hey, shortcuts work too!
> That's obviously a pretty fundamental change. I think there's merit
> in it, but I'm not going to pursue it. It seems pretty clear to me
> that when you say "require_gem X", then X should be the _name_ of a
As I said above, IMHO require_gem 'X' is no better than require 'x'
(X == gem name, x == 'real path' on disk):
* auto_require is but a minor convenience since most libs already provide
something similar by installing libfoo.rb under sitelibdir
* yet you make that program dependent on RubyGems and force all the
other repackagers to patch it carefully (and we certainly don't want
to make the task of FreeBSD/Debian/Gentoo/PLD/RPA/etc harder).
With the require-alike semantics, it'd be easier to remove the
versioning info and just s/require_gem/require/ so they can use their
own versioning system.
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
More information about the Rubygems-developers