Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top