From: "Ara.T.Howard" Date: 2003-11-25T18:27:12+09:00 Subject: Re: raise unless RUBY_VERSION[%r/^\s*\d+\.\d+/o].to_f >= 1.8 On Tue, 25 Nov 2003, Gennady wrote: > Date: Tue, 25 Nov 2003 14:56:03 +0900 > From: Gennady > Newsgroups: comp.lang.ruby > Subject: Re: raise unless RUBY_VERSION[%r/^\s*\d+\.\d+/o].to_f >= 1.8 > > > > On Nov 24, 2003, at 20:42, Ara.T.Howard wrote: > > > On Tue, 25 Nov 2003, Florian Gross wrote: > > > >> Date: Tue, 25 Nov 2003 08:54:02 +0900 > >> From: Florian Gross > >> Newsgroups: comp.lang.ruby > >> Subject: Re: raise unless RUBY_VERSION[%r/^\s*\d+\.\d+/o].to_f >= 1.8 > >> > >> Moin! > >> > >> Ara.T.Howard wrote: > >> > >>> any better methods of require a specific version/set of versions? > >> > >> What about RUBY_VERSION >= "1.8.0"? > >> > >> Regards, > >> Florian Gross > > > > i thought about this for a while and came up with a good reason not to > > do this > > - but it currently eludes me! > > > > unless someone can think of a reason not to - i'll take it! > > It does not work as a general solution, as "1.11.0" < "1.8.0". However, > bearing in mind that Ruby so far had only 1-digit version components > and 1.9.x is going to be the last Ruby1 version (according to Matz), > this check may be OK. 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. it would be really good if there was a 'standard' way to do this. at one point, i created a Version class which used the rules that 'ld' follows: interface.age.revision etc. etc. does anyone know what the meaning of ruby's tripplet? -a -- ATTN: please update your address books with address below! =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | STP :: http://www.ngdc.noaa.gov/stp/ | NGDC :: http://www.ngdc.noaa.gov/ | NESDIS :: http://www.nesdis.noaa.gov/ | NOAA :: http://www.noaa.gov/ | US DOC :: http://www.commerce.gov/ | | The difference between art and science is that science is what we | understand well enough to explain to a computer. | Art is everything else. | -- Donald Knuth, "Discover" | | /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' ===============================================================================