Module: VersionGem::Ruby

Defined in:
lib/version_gem/ruby.rb

Overview

Helpers for library CI integration against many different versions of Ruby

Constant Summary collapse

RUBY_VER =
::Gem::Version.new(RUBY_VERSION)

Class Method Summary collapse

Class Method Details

.actual_minor_version?(major, minor, engine = "ruby") ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/version_gem/ruby.rb', line 11

def actual_minor_version?(major, minor, engine = "ruby")
  major.to_i == RUBY_VER.segments[0] &&
    minor.to_i == RUBY_VER.segments[1] &&
    ::RUBY_ENGINE == engine
end

.gte_minimum_version?(version, engine = "ruby") ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/version_gem/ruby.rb', line 6

def gte_minimum_version?(version, engine = "ruby")
  RUBY_VER >= ::Gem::Version.new(version) && ::RUBY_ENGINE == engine
end