module QCloudHive class GITURLDecoder attr_reader :originURL attr_reader :projectName attr_reader :name def initialize(originURL) @originURL = originURL if @originURL == nil raise NameError("改地址为空!!!") end uri = URI(originURL) uriPath = uri.path.split(".").first if uriPath.start_with?("/") uriPath= uriPath[1..uriPath.length] end name = uriPath.split("/").last @projectName = uriPath @name = name end def validate?() if @originURL == nil return false end if @name == nil return false end if @projectName == nil return false end return true end end end module Git class Base def clean?() begin if status.changed.count > 0 L.info("****************************") L.info("changed #{status.changed}") return false end if status.untracked.count >0 L.info("****************************") L.info("untracked #{status.untracked}") return false end if status.deleted.count > 0 L.info("****************************") L.info("deleted #{status.deleted}") return false end if status.added.count > 0 L.info("****************************") L.info("added #{status.added}") return false end rescue => err puts "读取Git数据失败#{err}" return false end return true end end class Branch def local? full.start_with?("remotes") == false end end end