From: sabbyxtabby@... (Sabby and Tabby) Date: 2003-11-26T05:07:11+09:00 Subject: Re: raise unless RUBY_VERSION[%r/^\s*\d+\.\d+/o].to_f >= 1.8 "Ara.T.Howard" wrote: > On Tue, 25 Nov 2003, Gennady wrote: > > > > On Tue, 25 Nov 2003, Florian Gross wrote: > > > > > >> What about RUBY_VERSION >= "1.8.0"? > > > > It does not work as a general solution, as "1.11.0" < "1.8.0". > > ah yes - _did_ think of that at one point. must have drank more coffee that > day. thatnks for the heads up. definitely best to stick with a 'to_f' type > impl for now. Unfortunately, 'to_f' suffers the same problem, since 1.11 < 1.8. Numerically compare each part of version string: require 'scanf.rb' raise unless (RUBY_VERSION.scanf("%d.%d.%d") <=> [1,8]) >= 0