Module: ForemanMaintain::Concerns::Versions

Included in:
Scenario
Defined in:
lib/foreman_maintain/concerns/versions.rb

Instance Method Summary collapse

Instance Method Details

#at_least_version?(version) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/foreman_maintain/concerns/versions.rb', line 8

def at_least_version?(version)
  Gem::Version.new(current_version) >= Gem::Version.new(version)
end

#current_minor_versionObject



12
13
14
# File 'lib/foreman_maintain/concerns/versions.rb', line 12

def current_minor_version
  current_version.to_s[/^\d+\.\d+/]
end

#less_than_version?(version) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/foreman_maintain/concerns/versions.rb', line 4

def less_than_version?(version)
  Gem::Version.new(current_version) < Gem::Version.new(version)
end