Module: Sambot::Runtime

Defined in:
lib/sambot/runtime.rb

Class Method Summary collapse

Class Method Details

.ensure_latestObject



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

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

.obsolete?Boolean

Returns:

  • (Boolean)


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

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