tags:

views:

42

answers:

2

hi

I want to check with "gem outdated" if there are any gem updates. Is it possible to get the result of the gem software in a script as string or value?

I don't want to execute system() oder something similar.

thanks for your help

+1  A: 

RubyGems is actually a library, the gem commandline tool is only a small wrapper around that library. You can do anything you can do with the commandline tool from that library (and indeed some things you can't do with the commandline tool).

However, the library API is not as well documented as the commandline tool's parameters. There is a testuite, though.

Jörg W Mittag
+1  A: 

It's can help you

require 'rubygems/commands/outdated_command.rb'

g = Gem::Commands::OutdatedCommand.new()
g.execute()
# => [] for me ))

You can find other commands in directory lib/ruby/1.9.1/rubygems/commands/

aaz