From: brian ford Date: 2010-02-03T12:42:51+09:00 Subject: [ruby-core:28025] Re: RCR: RUBY_VERSION_INT Hi, On Tue, Feb 2, 2010 at 2:45 PM, Nobuyoshi Nakada wrote: > Hi, > > At Wed, 3 Feb 2010 04:39:12 +0900, > Roger Pack wrote in [ruby-core:28015]: >> Currently in a .rb file, to determine if you're on 1.9 versus 1.8 is >> not all that straight forward. > > -1. > > For what do you need it? �I think there should be better tests > than version comarison. I have a method of comparing version strings in MSpec for the RubySpec ruby_version_is guards: http://github.com/rubyspec/mspec/blob/master/lib/mspec/utils/version.rb Personally, I'd like to see RUBY_VERSION be an object that would allow proper comparison rather than a String. In many cases, it may be better to check #respond_to? or one of the #[xxx_]method_defined? for specific features, but version comparison is sometimes the easiest way to check for a feature. Cheers, Brian > > -- > Nobu Nakada > >