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
-
.actual_minor_version?(major, minor, engine = "ruby") ⇒ Boolean
Check if the current Ruby version (MAJOR.MINOR) is equal to the given version.
-
.gte_minimum_version?(version, engine = "ruby") ⇒ Boolean
Check if the current Ruby version is greater than or equal to the given version.
Class Method Details
.actual_minor_version?(major, minor, engine = "ruby") ⇒ Boolean
Check if the current Ruby version (MAJOR.MINOR) is equal to the given version
15 16 17 18 19 20 |
# File 'lib/version_gem/ruby.rb', line 15 def actual_minor_version?(major, minor, engine = "ruby") segs = RUBY_VER.segments major.to_i == segs[0] && minor.to_i == segs[1] && ::RUBY_ENGINE == engine end |
.gte_minimum_version?(version, engine = "ruby") ⇒ Boolean
Check if the current Ruby version is greater than or equal to the given version
9 10 11 |
# File 'lib/version_gem/ruby.rb', line 9 def gte_minimum_version?(version, engine = "ruby") RUBY_VER >= ::Gem::Version.new(version) && ::RUBY_ENGINE == engine end |