Sha256: a8ff31a4b8ecb1b2ff35dfce255d429827cb57b1379c31af3cff17b0979c5a0b

Contents?: true

Size: 646 Bytes

Versions: 13

Compression:

Stored size: 646 Bytes

Contents

# encoding: utf-8

module Synvert::Core
  # GemSpec checks and compares gem version.
  class Rewriter::RubyVersion
    # Initialize a ruby_version.
    #
    # @param version [String] ruby version
    def initialize(version)
      @version = version
    end

    # Check if the specified ruby version matches current ruby version.
    #
    # @return [Boolean] true if matches, otherwise false.
    def match?
      # Gem::Version initialize will strip RUBY_VERSION directly in ruby 1.9,
      # which is solved from ruby 2.0.0, which calls dup internally.
      Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new(@version)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
synvert-core-0.15.2 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.15.1 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.15.0 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.14.0 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.13.2 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.13.1 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.13.0 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.12.0 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.11.1 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.11.0 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.10.0 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.9.1 lib/synvert/core/rewriter/ruby_version.rb
synvert-core-0.9.0 lib/synvert/core/rewriter/ruby_version.rb