class FurionVersion

Public Class Methods

checkUpdate() click to toggle source
# 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
getCurVersion() click to toggle source
# File lib/furion/version_update.rb, line 12
def self.getCurVersion
  return $CurrentFurionVerion
end
getLatestVersion() click to toggle source
# 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