From: ara.t.howard@... Date: 2006-03-25T23:40:04+09:00 Subject: Re: require a certain version of the ruby interpreter On Sat, 25 Mar 2006, Ross Bamford wrote: > def ensure_version(v) > raise "need #{v}" if VERSION.split('.').zip(v.split('.')).any? {|a,b| a < b} > end > > (given that we don't need to worry about two-digit versions of course). harp:~ > cat a.rb def ensure_version(v) raise "need #{v}" if VERSION.split('.').zip(v.split('.')).any? {|a,b| a < b} end ensure_version "1.8.4" harp:~ > /usr/bin/ruby a.rb a.rb:2:in `ensure_version': undefined method `zip' for ["1", "6", "8"]:Array (NameError) from a.rb:4 my point is that this code does not 'ensure' version 1.8.4 - it blows up unless version 1.8.x. regards. -a -- share your knowledge. it's a way to achieve immortality. - h.h. the 14th dali lama