When you run the command gem outdated -V
, the output of the command displays something similar to this:
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
This will send you a gzip file that contains another file called latest_specs.4.8
which you can Marshal.load
with a simple Ruby app like so:
require 'pp'
require 'rubygems/version'
# This assumes you've downloaded the file to the current directory
pp Marshal.load(File.open('latest_specs.4.8'))
Run this and it will pretty print a multi-dimensional Array
that looks like so:
[
["rails", Gem::Version.new("2.3.5"), "ruby"],
["sinatra", Gem::Version.new("0.9.4"), "ruby"],
["watir", Gem::Version.new("1.6.5"), "ruby"]
]
Pretty simple, but I am trying to make a C# RubyGems GUI application that would alert you when you have outdated gems.
Now, since the latest_specs file is marshaled by Ruby, is there any way I could access it within C# without running the system command gem outdated
?