module VersionGem::Ruby

Helpers for library CI integration against many different versions of Ruby

Constants

RUBY_VER

Public Class Methods

actual_minor_version?(major, minor, engine = "ruby") click to toggle source

Check if the current Ruby version (MAJOR.MINOR) is equal to the given version

   # File lib/version_gem/ruby.rb
15 def actual_minor_version?(major, minor, engine = "ruby")
16   segs = RUBY_VER.segments
17   major.to_i == segs[0] &&
18     minor.to_i == segs[1] &&
19     ::RUBY_ENGINE == engine
20 end
gte_minimum_version?(version, engine = "ruby") click to toggle source

Check if the current Ruby version is greater than or equal to the given version

   # File lib/version_gem/ruby.rb
 9 def gte_minimum_version?(version, engine = "ruby")
10   RUBY_VER >= ::Gem::Version.new(version) && ::RUBY_ENGINE == engine
11 end

Private Instance Methods

actual_minor_version?(major, minor, engine = "ruby") click to toggle source

Check if the current Ruby version (MAJOR.MINOR) is equal to the given version

   # File lib/version_gem/ruby.rb
15 def actual_minor_version?(major, minor, engine = "ruby")
16   segs = RUBY_VER.segments
17   major.to_i == segs[0] &&
18     minor.to_i == segs[1] &&
19     ::RUBY_ENGINE == engine
20 end
gte_minimum_version?(version, engine = "ruby") click to toggle source

Check if the current Ruby version is greater than or equal to the given version

   # File lib/version_gem/ruby.rb
 9 def gte_minimum_version?(version, engine = "ruby")
10   RUBY_VER >= ::Gem::Version.new(version) && ::RUBY_ENGINE == engine
11 end