class QCloudHive::GITURLDecoder
Attributes
name[R]
originURL[R]
projectName[R]
Public Class Methods
new(originURL)
click to toggle source
# File lib/qcloudhive/git_helper.rb, line 8 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
Public Instance Methods
validate?()
click to toggle source
# File lib/qcloudhive/git_helper.rb, line 22 def validate?() if @originURL == nil return false end if @name == nil return false end if @projectName == nil return false end return true end