class Object

Constants

L

Public Instance Methods

DZCopyFile(originPath , aimPath , dir) click to toggle source
# File lib/qcloudhive/utils.rb, line 7
def DZCopyFile(originPath , aimPath , dir)
  fileOriginPath = originPath
  argv = " "
  if File.exist?(aimPath)
    puts aimPath  + " already exsit! Will update"
    if dir
      argv = " -r -f -p "
    else
      argv = " -f -p "
    end
  else
    if dir
      argv = " -r -p"
    end
  end
  Rake::sh "cp "+ argv + " " + fileOriginPath + " " + aimPath
end
Error(msg) click to toggle source
# File lib/qcloudhive/utils.rb, line 36
def Error(msg)
  puts msg
  exit(1)
end
GetOptValue(cmd, opts, name) click to toggle source
# File lib/qcloudhive/utils.rb, line 25
def GetOptValue(cmd, opts, name)
  value = opts[name]
  L.debug "name is #{name} value is #{value}"
  if value == nil
    puts "您没有输入必须输入的参数#{name}"
    puts cmd.help
    exit(1)
  end
  return  value
end
VersionStrToNumber(str) click to toggle source
# File lib/qcloudhive/utils.rb, line 41
def VersionStrToNumber(str)
  if str == None
    return 0
  end
  
end