require 'rake' require 'uri' require 'logger' L = Logger.new(STDOUT) 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 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 def Error(msg) puts msg exit(1) end def VersionStrToNumber(str) if str == None return 0 end end