Class: Gemat::Gem
- Inherits:
-
Object
- Object
- Gemat::Gem
- Defined in:
- lib/gem.rb
Instance Attribute Summary collapse
-
#github ⇒ Object
Returns the value of attribute github.
-
#index ⇒ Object
Returns the value of attribute index.
-
#rubygems ⇒ Object
Returns the value of attribute rubygems.
Instance Method Summary collapse
-
#initialize(rubygems) ⇒ Gem
constructor
A new instance of Gem.
- #repo_uri ⇒ Object
Constructor Details
#initialize(rubygems) ⇒ Gem
Returns a new instance of Gem.
7 8 9 10 |
# File 'lib/gem.rb', line 7 def initialize(rubygems) @rubygems = rubygems @index = 0 end |
Instance Attribute Details
#github ⇒ Object
Returns the value of attribute github.
5 6 7 |
# File 'lib/gem.rb', line 5 def github @github end |
#index ⇒ Object
Returns the value of attribute index.
5 6 7 |
# File 'lib/gem.rb', line 5 def index @index end |
#rubygems ⇒ Object
Returns the value of attribute rubygems.
5 6 7 |
# File 'lib/gem.rb', line 5 def rubygems @rubygems end |
Instance Method Details
#repo_uri ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gem.rb', line 12 def repo_uri match = github_uri_match([@rubygems.dig('metadata', 'homepage_uri'), @rubygems['homepage_uri'], @rubygems['bug_tracker_uri'], @rubygems['source_code_uri']]) return if match.nil? user = match[1] repo = match[2] "https://github.com/#{user}/#{repo}" end |