Class: CompareLinker::GithubTagFinder
- Inherits:
-
Object
- Object
- CompareLinker::GithubTagFinder
- Defined in:
- lib/compare_linker/github_tag_finder.rb
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#octokit ⇒ Object
readonly
Returns the value of attribute octokit.
-
#repo_full_name ⇒ Object
readonly
Returns the value of attribute repo_full_name.
Instance Method Summary collapse
- #find(gem_version) ⇒ Object
-
#initialize(octokit, gem_name, repo_full_name) ⇒ GithubTagFinder
constructor
A new instance of GithubTagFinder.
Constructor Details
#initialize(octokit, gem_name, repo_full_name) ⇒ GithubTagFinder
Returns a new instance of GithubTagFinder.
5 6 7 8 9 |
# File 'lib/compare_linker/github_tag_finder.rb', line 5 def initialize(octokit, gem_name, repo_full_name) @octokit = octokit @gem_name = gem_name @repo_full_name = repo_full_name end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
3 4 5 |
# File 'lib/compare_linker/github_tag_finder.rb', line 3 def gem_name @gem_name end |
#octokit ⇒ Object (readonly)
Returns the value of attribute octokit.
3 4 5 |
# File 'lib/compare_linker/github_tag_finder.rb', line 3 def octokit @octokit end |
#repo_full_name ⇒ Object (readonly)
Returns the value of attribute repo_full_name.
3 4 5 |
# File 'lib/compare_linker/github_tag_finder.rb', line 3 def repo_full_name @repo_full_name end |
Instance Method Details
#find(gem_version) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/compare_linker/github_tag_finder.rb', line 11 def find(gem_version) = auto_paginate { octokit.(repo_full_name) } if .find { |tag| tag.name == gem_version || tag.name == "v#{gem_version}" || tag.name == "#{gem_name}-#{gem_version}" } end end |