Class: FurionVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/furion/version_update.rb

Class Method Summary collapse

Class Method Details

.checkUpdateObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/furion/version_update.rb', line 24

def self.checkUpdate
  curVersion = getCurVersion
  latestVersion = getLatestVersion

  if curVersion != latestVersion
    content = "new version:["+ latestVersion +"] detected\ncurrent:["+curVersion+"]\nto update: 'sudo gem install furion' "
    puts content.red
    return 0
  end
  return 1
end

.getCurVersionObject



12
13
14
# File 'lib/furion/version_update.rb', line 12

def self.getCurVersion
  return $CurrentFurionVerion
end

.getLatestVersionObject



16
17
18
19
20
# File 'lib/furion/version_update.rb', line 16

def self.getLatestVersion
  data = open($CheckVersionURL){|f| f.read}
  dict = JSON.parse(data)
  return dict["version"]
end