[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Gems package manager

Jeffrey Moss

1/26/2005 10:12:00 PM

I have a few suggestions for the rubygems package manager

If you have to use require_gem to load your library, it aught to have a config option to download the most recent version automatically as your script is executing. That would make it 10x more useful to me.

There should also be a config option to create symbolic links (or shortcuts) to the most recently installed packages in the site_ruby directory when you install a gem, so that you can skip the require_gem and instead just require directly from site_ruby. Maybe the gems command can switch your default version around (replace the symlink). I would prefer to have that flexibility there also.

-Jeff
5 Answers

Dick Davies

1/26/2005 10:36:00 PM

0

* Jeffrey Moss <jeff@opendbms.com> [0112 22:12]:
> I have a few suggestions for the rubygems package manager
>
> If you have to use require_gem to load your library, it aught to have a config option to download the most recent version automatically as your script is executing. That would make it 10x more useful to me.

How much easier does this make your life? 10x ? I can't see how to be honest.
Off the top of me head:

* a change in the API in the more recent version would break your code
* would unit tests also trigger this auto-download?
* are you always running ruby as root?
( if yes, are you happy downloading code off the net to run as root?
if no, are you going to give each user their own gem directory?
)
* is the network always available?
* wouldn't you rather know what version of someone elses code you're running?

> There should also be a config option to create symbolic links (or shortcuts) to the most recently installed packages in the site_ruby directory when you install a gem, so that you can skip the require_gem and instead just require directly from site_ruby. Maybe the gems command can switch your default version around (replace the symlink). I would prefer to have that flexibility there also.

If you :

a) "require 'ubygems'"
b) add a '-rubygems' to your command line
or
c) set RUBYOPT='rubygems' in your environment

you can use require and it defaults to the latest gem.

See

http://onestepback.org/articles/rubygemsfacets/...

for more blurb.

Both these ideas were discussed at length back in the mists of time
when rubygems was young ( last summer ) - see the rubygems list archives.

--
'Bender, Ship, stop arguing or I'll come back there and change
your opinions manually.'
-- Leela
Rasputin :: Jack of All Trades - Master of Nuns


Martijn Hoogendoorn

1/26/2005 10:37:00 PM

0

Op woensdag 26 januari 2005 23:12, schreef Jeffrey Moss:
> If you have to use require_gem to load your library, it aught to have a
> config option to download the most recent version automatically as your
> script is executing. That would make it 10x more useful to me.
Most programs are not run with sufficient priviliges to write in the
system-wide Ruby directory. Perhaps if you could install gems per user,
without the need to install Ruby in your home directory.

> There should also be a config option to create symbolic links (or
> shortcuts) to the most recently installed packages in the site_ruby
> directory when you install a gem, so that you can skip the require_gem and
> instead just require directly from site_ruby.
As of RubyGems 0.7.0 by default a stub is installed, so you can just use:

require 'somelib'

instead of:

require 'rubygems'
require_gem 'somelib'

However, only when using require_gem can you request a specific version, as
in:

require_gem 'somelib', '>= 0.1.0'

met vriendelijke groet,
Martijn Hoogendoorn.


Dick Davies

1/26/2005 10:45:00 PM

0

* Martijn Hoogendoorn <m.hoogendoorn@home.nl> [0137 22:37]:
> As of RubyGems 0.7.0 by default a stub is installed, so you can just use:
>
> require 'somelib'

Stubs are sooo 0.7.0'y ....
(they got taken out in 0.8.something)

http://onestepback.org/articles/rubygemsfacets/stubsvsrequir...

To be honest I tried rubygems circa 0.5.0 and gave up because I couldn't
figure out how to get native gems to build. Seems like it's the standard now, so
I need to get it back on my todo list.

Does anyone have some up-to-date docs on rubygems?
The wiki doesn't seem to be maintained....

--
'If we can hit that bull's-eye, the rest of the dominoes will fall like a
house of cards... Checkmate!'
-- Zapp. Brannigan
Rasputin :: Jack of All Trades - Master of Nuns


Dick Davies

1/26/2005 11:13:00 PM

0

* Dick Davies <rasputnik@hellooperator.net> [0144 22:44]:

> Does anyone have some up-to-date docs on rubygems?
> The wiki doesn't seem to be maintained....

Let me take that back ... had one of the older pages on
the wiki bookmarked; the url should have given me a clue

http://rubygems.rubyforge.org/wiki/wiki.pl?OldCommandInterface/QuickIn...
^^^^^^^^^^^^^^^^^^^

doh.
(this is what i get for running firefox with the fullscreen extension...)


--
'common sense is what tells you that the world is flat.'
-- Principia Discordia
Rasputin :: Jack of All Trades - Master of Nuns


Jeffrey Moss

1/26/2005 11:21:00 PM

0

Thanks for the info, I will set my environment like you suggested Dick.

However...

I still think configuration options for automatically installing packages,
whether in the users home directory, the site wide gems directory or a
special webserver directory, would be extremely useful. I was saying it
would make the app more useful Dick, not my life (which is easy enough
already!)

-Jeff

----- Original Message -----
From: "Martijn Hoogendoorn" <m.hoogendoorn@home.nl>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Wednesday, January 26, 2005 3:36 PM
Subject: Re: Gems package manager


> Op woensdag 26 januari 2005 23:12, schreef Jeffrey Moss:
>> If you have to use require_gem to load your library, it aught to have a
>> config option to download the most recent version automatically as your
>> script is executing. That would make it 10x more useful to me.
> Most programs are not run with sufficient priviliges to write in the
> system-wide Ruby directory. Perhaps if you could install gems per user,
> without the need to install Ruby in your home directory.
>
>> There should also be a config option to create symbolic links (or
>> shortcuts) to the most recently installed packages in the site_ruby
>> directory when you install a gem, so that you can skip the require_gem
>> and
>> instead just require directly from site_ruby.
> As of RubyGems 0.7.0 by default a stub is installed, so you can just use:
>
> require 'somelib'
>
> instead of:
>
> require 'rubygems'
> require_gem 'somelib'
>
> However, only when using require_gem can you request a specific version,
> as
> in:
>
> require_gem 'somelib', '>= 0.1.0'
>
> met vriendelijke groet,
> Martijn Hoogendoorn.
>