Class: Reactive::Updater::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/reactive-core/updater/base.rb

Direct Known Subclasses

Cli, Gui

Instance Method Summary collapse

Instance Method Details

#current_versionObject



8
9
10
# File 'lib/reactive-core/updater/base.rb', line 8

def current_version
  Gem.loaded_specs[APP_NAME].version
end

#last_available_versionObject



16
17
18
19
# File 'lib/reactive-core/updater/base.rb', line 16

def last_available_version
  spec = Gem::SourceInfoCache.search("^#{APP_NAME}$").last
  spec && spec.version
end

#update_available?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/reactive-core/updater/base.rb', line 12

def update_available?
  (spec = Gem::SourceInfoCache.search("^#{APP_NAME}$").last) && (spec.version > current_version)
end