Class: API::RemoteSourceVCS
- Inherits:
-
Object
- Object
- API::RemoteSourceVCS
- Defined in:
- lib/api.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#vcs ⇒ Object
readonly
Returns the value of attribute vcs.
Instance Method Summary collapse
- #get_homepage ⇒ Object
- #get_last_commit ⇒ Object
-
#initialize(url) ⇒ RemoteSourceVCS
constructor
A new instance of RemoteSourceVCS.
Constructor Details
#initialize(url) ⇒ RemoteSourceVCS
Returns a new instance of RemoteSourceVCS.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/api.rb', line 18 def initialize(url) @url = url if url =~ API::SOURCE_URL_PATTERN[:golang_org] url = API::GolangOrg.new(url).repo_url end @vcs = if url =~ API::SOURCE_URL_PATTERN[:github] API::Github.new(url) elsif url =~ API::SOURCE_URL_PATTERN[:git_kernel_org] API::GitKernelOrg.new(url) elsif url =~ API::SOURCE_URL_PATTERN[:bitbucket] API::Bitbucket.new(url) elsif url =~ API::SOURCE_URL_PATTERN[:google_source_com] API::GoogleSourceCom.new(url) elsif url =~ API::SOURCE_URL_PATTERN[:code_google_com] API::CodeGoogleCom.new(url) elsif url =~ API::SOURCE_URL_PATTERN[:go_pkg_in] API::GoPkgIn.new(url) else nil # raise "Unknown repostory: #{url}" end end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
17 18 19 |
# File 'lib/api.rb', line 17 def url @url end |
#vcs ⇒ Object (readonly)
Returns the value of attribute vcs.
17 18 19 |
# File 'lib/api.rb', line 17 def vcs @vcs end |