[Rubygems-developers] GUI Interfacing with rubygems?

Eric Hodel drbrain at segment7.net
Thu Dec 28 15:04:14 EST 2006

On Dec 28, 2006, at 11:42, Chad Woolley wrote:

> Hey Eloy,
> I've done this in my GemInstaller project:
> http://rubyforge.org/projects/geminstaller/
> This is almost ready for release.  I didn't know about rubyslippers
> until now, I'm going to look at it, because I've run into a few
> hitches.  Maybe it will give me some ideas.  The biggest problems I've
> run into are:
> * There's no really cohesive API for RubyGems.  Whether you use the
> command line or the api, you have to do parsing out text and acting on
> it (parsing versions/platforms/etc).  If you want to use it
> programatically, you have to hit a few classes.

I've done a ton of work on this for the 0.9.1 release.  Methods have  
shifted around and the RemoteInstaller has been drastically cut down  
in capabilities.  Those capabilities have all moved to other  
locations where they make more sense.  (I did all this to perform  
automatic sandbox gem installs for my secret project.)

> I've got proxies for GemRunner and SourceIndex, and some mixin  
> hacks for StreamUI so I can intercept stdin and stdout.

Why do you need a proxy for SourceIndex?  Its pretty much self- 

> * Specifying platforms for multiplatform gems.  Currently, there is no
> way to specify platform via a command line option or API.  It's
> hardcoded to always present a list if theres a binary (non-ruby) gem,
> and ask for the user to make a choice via stdin (which I had to work
> around with the mixin hacks for StreamUI).  There is talk of changing
> this, but the developers want to gather data on what platforms people
> use first.  I'd really like to just get a command line option for
> platform added ASAP - hint hint :)

This is on the table for 0.9.2.  It was too big of a change to make  
for 0.9.1.  Chad and Jim have a side project that'll get us  
information to help with this too.

> *  Dealing with sudo.  This is currently my only remaining blocker for
> releasing geminstaller.  Must people have rubygems installed as root,
> so commands that modify the gem repository must be run via sudo.  I
> would like to have a command line option --sudo which uses sudo to run
> gems, but this doesn't work if you are calling into the API
> programatically.  On the other hand, I could use the command line
> interface, but this is also tricky in ruby, to properly deal with
> stderr, stdin, and timeouts if the gem command is expecting different
> stdin than you think it is.

0.9.1 will not download gems from the server if everything is up-to- 
date.  This will give fewer instances where gems will need to read  
from the console (of course, there's always the platform problem).

(In 0.9.2 I'd like to pull most of RemoteInstaller's functionality  
into a DependencyInstaller which will make network-free installs much  

> Also, if you use the command line, you have to parse errors out of  
> stdout/stderr as opposed to just catching exceptions.  If anyone  
> has ideas here, please let me know.

0.9.1 raises many, many more exceptions (and useful ones, at that)  
and outputs to stdout much less (especially for extension building).

Eric Hodel - drbrain at segment7.net - http://blog.segment7.net


More information about the Rubygems-developers mailing list