From: Lars Olsson Date: 2010-08-17T02:20:16+09:00 Subject: Re: Determining whether the running ruby is outdated? On 11 Aug, 21:35, Luis Lavena wrote: > On Aug 11, 4:29 pm, Dan Rathbun wrote: > > > Lars, I found where the information is in each package. > > > It is in the version.h file (a C source header file.) > > > In the some of the older precompiled packages, a copy of this file, is > > placed in the #{platform} subdir of the ruby/lib/ruby/#{engine} > > directory. > > In newer precompiled packages, it cannot find it and it may have been > > replaced with rbconfig.rb > > No, all versions of MRI (Matz Ruby Implementation) still stores > version information in a C header, not Ruby code. > > > In the source packages, the file is in the source/#{ver-patchlevel} dir > > of the source archives. > > The problem with them is thay are all in compressed archives (tarballs > > or zips,) so you cannot read them over the net. > > Yes, the only workaround is download, extract and find the file. > > In RubyInstaller we know what we are looking for: > > http://github.com/oneclick/rubyinstaller/blob/master/recipes/packager...http://github.com/oneclick/rubyinstaller/blob/master/recipes/packager... > > Do a Dir.glob and look for version.h > > -- > Luis Lavena Thanks everybody for all of your suggestions. I finally decided that the downloads available from ftp.ruby-lang.org provide me with the information I need. Even though the information obtained cannot be guaranteed to be accurate, the naming scheme on that site seems quite stable. If someone is interested the app is available on github: http://github.com/lasso/random/raw/master/runtimeinfo.rb And here are the results from my current irb session: irb(main):001:0> load 'runtimeinfo.rb' => true irb(main):002:0> puts Lassoweb::Utils::RuntimeInfo.latest_ruby_versions Latest stable version: 1.9.1-p430 Latest release candidate: 1.9.2-rc2 Latest preview: 1.9.2-preview3 => nil /lasso