Module: Sambot::Domain::Common::Runtime

Defined in:
lib/sambot/domain/common/runtime.rb

Class Method Summary collapse

Class Method Details

.ensure_latestObject



13
14
15
16
17
18
19
20
# File 'lib/sambot/domain/common/runtime.rb', line 13

def self.ensure_latest
  latest_version = Gems.new.versions('sambot')[0]["number"]
  UI.debug("Current Sambot version is #{Sambot::VERSION}.")
  UI.debug("Latest Sambot version is #{latest_version}.")
  if is_obsolete
    UI.info('A newer version of the sambot gem exists. Please update the gem before continuing.', :red)
  end
end

.is_obsoleteObject



8
9
10
11
# File 'lib/sambot/domain/common/runtime.rb', line 8

def self.is_obsolete
  latest_version = Gems.new.versions('sambot')[0]["number"]
  Gem::Version.new(Sambot::VERSION) < Gem::Version.new(latest_version)
end