Shea Martin wrote:
> I would like to enforce ruby 1.8.4 or higher.
> 
> if VERSION < "1.8.4"
>     raise "Invalid version"
> end
> 
> Fails when VERSION is "1.8.10".
> 
> Yeah, I know I could write my own string comparison, but was wondering 
> if there is a canned solution for this?
> 
> ~S


This works nicely, but I am sure something like this is already built 
in, but I can't seem to find it.

def require_version( p_ver_str )
   l_have = VERSION.split('.')
   l_need = p_ver_str.split('.')
   l_need.each_index do |i|
     if l_have[i].to_i < l_need[i].to_i
       raise ScriptError, "Required Ruby #{p_ver_str}, found Ruby 
#{VERSION}"
     end
   end
end

~S