Class: Bundler::Alive::SourceCodeRepositoryUrl
- Inherits:
-
Object
- Object
- Bundler::Alive::SourceCodeRepositoryUrl
- Defined in:
- lib/bundler/alive/source_code_repository_url.rb
Overview
Represents a source code repository
Defined Under Namespace
Classes: UnSupportedUrl
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.support_url?(url) ⇒ Boolean
Judge supported url or not.
Instance Method Summary collapse
-
#initialize(url, name) ⇒ SourceCodeRepositoryUrl
constructor
Creates a
SourceCodeRepositoryUrl
.
Constructor Details
#initialize(url, name) ⇒ SourceCodeRepositoryUrl
Creates a SourceCodeRepositoryUrl
63 64 65 66 67 68 69 |
# File 'lib/bundler/alive/source_code_repository_url.rb', line 63 def initialize(url, name) raise UnSupportedUrl.new(url: url, name: name) if url.nil? @url = url @service_name = service(url: url, name: name) @gem_name = name end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
53 54 55 |
# File 'lib/bundler/alive/source_code_repository_url.rb', line 53 def gem_name @gem_name end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
53 54 55 |
# File 'lib/bundler/alive/source_code_repository_url.rb', line 53 def service_name @service_name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
53 54 55 |
# File 'lib/bundler/alive/source_code_repository_url.rb', line 53 def url @url end |
Class Method Details
.support_url?(url) ⇒ Boolean
Judge supported url or not
23 24 25 26 27 28 29 30 |
# File 'lib/bundler/alive/source_code_repository_url.rb', line 23 def self.support_url?(url) return false if url.nil? uri = URI.parse(url) host = uri.host DOMAIN_WITH_SERVICES.key?(host) end |