[Rubygems-developers] LOCAL/REMOTE tokens are not printed for non-tty

Eric Hodel drbrain at segment7.net
Fri Aug 1 16:20:20 EDT 2008

On Jul 31, 2008, at 14:43 PM, Martin Krauskopf wrote:
> Hi all, likely mainly Eric ;),
> what was the reason for the change:
>  .../rubyforge.org/rubygems$ svn di -r 1834:1835
>  ....
>  + * lib/rubygems/commands/query_command.rb:  Don't print LOCAL/REMOTE
>  + gems if stdout is not a TTY.
>  ....
> we use LOCAL and REMOTE lines as 'recognition tokens' when parsing
> output of the 'gem list <...>' in the Gem Manager in NetBeans Ruby  
> IDE.
> So with this change our 'parser' is broken.
> Any chance the change will be reverted (e.g. in RubyGems 1.2.1), so  
> the
> output remains backward compatible for cases like this?

The goal of the change is to make it easier to hook `gem` up to shell  
scripts, for example:

gem install rdoc
gem list | xargs gem rdoc --ri --rdoc

Do you run this usually like `gem list -b`?  I could add a special  
case for that.

> PS: I know that parsing of the output is poor solution, we are going  
> to
>    switch to pure one using RubyGems API in next versions of the Gem
>    Manager

Alternately, if you run `gem list -r` and `gem list -l` separately,  
you shouldn't need to parse anything.

More information about the Rubygems-developers mailing list