Module: Dory::Upgrade

Defined in:
lib/dory/upgrade.rb

Class Method Summary collapse

Class Method Details

.cleanupObject



19
20
21
# File 'lib/dory/upgrade.rb', line 19

def self.cleanup
  Dory::Sh.run_command('gem cleanup dory')
end

.installObject



15
16
17
# File 'lib/dory/upgrade.rb', line 15

def self.install
  Dory::Sh.run_command('gem install dory')
end

.new_versionObject



3
4
5
6
7
8
9
# File 'lib/dory/upgrade.rb', line 3

def self.new_version
  res = Dory::Sh.run_command('gem search -q dory')
  return false unless res.success?
  newver = /dory\s+\((.*)\)/.match(res.stdout)
  return false if !newver ||  newver.length != 2
  newver[1]
end

.outdated?(new_version = self.new_version) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/dory/upgrade.rb', line 11

def self.outdated?(new_version = self.new_version)
  return Dory.version != new_version
end