lib/irt/ruby_version.rb in irt-1.1.4 vs lib/irt/ruby_version.rb in irt-1.1.5
- old
+ new
@@ -1,21 +1,21 @@
module IRT
module RubyVersion
- extend self
-
class Version < Array
include Comparable
- def initialize(version=RUBY_VERSION)
- replace version.split('.').map(&:to_i)
- end
+ def initialize(version)
+ replace version.split('.').map(&:to_i)
+ end
end
+ extend self
+
[:>, :>=, :<, :<=, :==, :between?].each do |m|
define_method(m) do |*args|
vers = args.map{|a| Version.new(a)}
- Version.new.send m, *vers
+ Version.new(RUBY_VERSION).send m, *vers
end
end
end
end