From: Pit Capitain Date: 2006-03-25T21:13:22+09:00 Subject: Re: require a certain version of the ruby interpreter dblack@wobblini.net schrieb: > Here's yet another variation on the theme. (I thought I'd posted this > in my previous post but I didn't.) > > require 'scanf' > def ensure_version(need) > need.scanf("%d.%d.%d"). > zip(RUBY_VERSION.scanf("%d.%d.%d")).any? do |a,b| > a > b > end and raise "Requires at least #{need}" > end Both the solutions using any? aren't correct: puts RUBY_VERSION # => 1.8.4 ensure_version "1.6.8" # => Requires at least 1.6.8 (RuntimeError) Regards, Pit