Module: VersionGem::Ruby — Documentation by YARD 0.9.44

# 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

Returns:

- (`Boolean`)

    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] &&
        engine == ::RUBY_ENGINE
    end

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

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

Returns:

- (`Boolean`)

    9
    10
    11
    # File 'lib/version_gem/ruby.rb', line 9

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