Class: GemContribute::Project
- Inherits:
-
Data
- Object
- Data
- GemContribute::Project
- Defined in:
- lib/gem_contribute/project.rb
Overview
A gem resolved to a host repository.
‘host` is one of: “github.com”, “gitlab.com”, “codeberg.org”, or :unknown. When :unknown, owner/repo are nil and `metadata` may carry whatever URI we found so the user can at least see it.
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name
9 10 11 |
# File 'lib/gem_contribute/project.rb', line 9 def gem_name @gem_name end |
#host ⇒ Object (readonly)
Returns the value of attribute host
9 10 11 |
# File 'lib/gem_contribute/project.rb', line 9 def host @host end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
9 10 11 |
# File 'lib/gem_contribute/project.rb', line 9 def @metadata end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner
9 10 11 |
# File 'lib/gem_contribute/project.rb', line 9 def owner @owner end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo
9 10 11 |
# File 'lib/gem_contribute/project.rb', line 9 def repo @repo end |
Instance Method Details
#known_host? ⇒ Boolean
10 11 12 |
# File 'lib/gem_contribute/project.rb', line 10 def known_host? host.is_a?(String) end |
#url ⇒ Object
14 15 16 17 18 19 |
# File 'lib/gem_contribute/project.rb', line 14 def url return [:source_url] if && !known_host? return nil unless owner && repo "https://#{host}/#{owner}/#{repo}" end |