Sha256: d5a52dd47af90ca98aba205ec2438a1e2d501327e47eb9747eda5a195fdbd4e0

Contents?: true

Size: 404 Bytes

Versions: 22

Compression:

Stored size: 404 Bytes

Contents

module IRT
  module RubyVersion

    class Version < Array
      include Comparable

      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(RUBY_VERSION).send m, *vers
      end
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
irt-1.3.3 lib/irt/ruby_version.rb
irt-1.3.2 lib/irt/ruby_version.rb
irt-1.3.1 lib/irt/ruby_version.rb
irt-1.3.0 lib/irt/ruby_version.rb
irt-1.2.12 lib/irt/ruby_version.rb
irt-1.2.11 lib/irt/ruby_version.rb
irt-1.2.10 lib/irt/ruby_version.rb
irt-1.2.9 lib/irt/ruby_version.rb
irt-1.2.8 lib/irt/ruby_version.rb
irt-1.2.7 lib/irt/ruby_version.rb
irt-1.2.6 lib/irt/ruby_version.rb
irt-1.2.5 lib/irt/ruby_version.rb
irt-1.2.4 lib/irt/ruby_version.rb
irt-1.2.3 lib/irt/ruby_version.rb
irt-1.2.2 lib/irt/ruby_version.rb
irt-1.2.1 lib/irt/ruby_version.rb
irt-1.2.0 lib/irt/ruby_version.rb
irt-1.2.0.p02 lib/irt/ruby_version.rb
irt-1.2.0.p01 lib/irt/ruby_version.rb
irt-1.1.7 lib/irt/ruby_version.rb