Class: Gemdiff::OutdatedGem
- Inherits:
-
Object
- Object
- Gemdiff::OutdatedGem
- Defined in:
- lib/gemdiff/outdated_gem.rb
Constant Summary collapse
- LIST_NO_V =
gems that tag releases with tag names like 1.2.3 keep it alphabetical
%w[ atomic autoprefixer-rails babosa bullet cancan capybara compass erubi ffi google-api-client mail mysql2 net-ssh-gateway newrelic_rpm rack rvm-capistrano safe_yaml sass secure_headers slack-notifier signet twilio-ruby ].freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#new_version ⇒ Object
readonly
Returns the value of attribute new_version.
-
#old_version ⇒ Object
readonly
Returns the value of attribute old_version.
Instance Method Summary collapse
- #commits_url ⇒ Object
- #compare ⇒ Object
- #compare_message ⇒ Object
- #compare_url ⇒ Object
-
#initialize(name, old_version = nil, new_version = nil) ⇒ OutdatedGem
constructor
A new instance of OutdatedGem.
- #load_bundle_versions ⇒ Object
- #main ⇒ Object
- #missing_versions? ⇒ Boolean
- #open ⇒ Object
- #releases ⇒ Object
- #releases_url ⇒ Object
- #repo ⇒ Object
- #repo? ⇒ Boolean
- #set_versions(v_old, v_new) ⇒ Object
Constructor Details
#initialize(name, old_version = nil, new_version = nil) ⇒ OutdatedGem
Returns a new instance of OutdatedGem.
37 38 39 40 |
# File 'lib/gemdiff/outdated_gem.rb', line 37 def initialize(name, old_version = nil, new_version = nil) @name = find_name(name) set_versions old_version, new_version end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
35 36 37 |
# File 'lib/gemdiff/outdated_gem.rb', line 35 def name @name end |
#new_version ⇒ Object (readonly)
Returns the value of attribute new_version.
35 36 37 |
# File 'lib/gemdiff/outdated_gem.rb', line 35 def new_version @new_version end |
#old_version ⇒ Object (readonly)
Returns the value of attribute old_version.
35 36 37 |
# File 'lib/gemdiff/outdated_gem.rb', line 35 def old_version @old_version end |
Instance Method Details
#commits_url ⇒ Object
70 71 72 |
# File 'lib/gemdiff/outdated_gem.rb', line 70 def commits_url clean_url "#{repo}/commits/main" end |
#compare ⇒ Object
90 91 92 |
# File 'lib/gemdiff/outdated_gem.rb', line 90 def compare open_url(compare_url) if repo? end |
#compare_message ⇒ Object
74 75 76 |
# File 'lib/gemdiff/outdated_gem.rb', line 74 def "#{name}: #{new_version} > #{old_version}" end |
#compare_url ⇒ Object
78 79 80 |
# File 'lib/gemdiff/outdated_gem.rb', line 78 def compare_url clean_url "#{repo}/compare/#{compare_part}" end |
#load_bundle_versions ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/gemdiff/outdated_gem.rb', line 50 def load_bundle_versions outdated_gem = BundleInspector.new.get(@name) return false if outdated_gem.nil? @old_version ||= outdated_gem.old_version @new_version ||= outdated_gem.new_version true end |
#main ⇒ Object
82 83 84 |
# File 'lib/gemdiff/outdated_gem.rb', line 82 def main open_url(commits_url) if repo? end |
#missing_versions? ⇒ Boolean
46 47 48 |
# File 'lib/gemdiff/outdated_gem.rb', line 46 def missing_versions? @old_version.nil? || @new_version.nil? end |
#open ⇒ Object
94 95 96 |
# File 'lib/gemdiff/outdated_gem.rb', line 94 def open open_url(repo) if repo? end |
#releases ⇒ Object
86 87 88 |
# File 'lib/gemdiff/outdated_gem.rb', line 86 def releases open_url(releases_url) if repo? end |
#releases_url ⇒ Object
66 67 68 |
# File 'lib/gemdiff/outdated_gem.rb', line 66 def releases_url clean_url "#{repo}/releases" end |
#repo ⇒ Object
58 59 60 |
# File 'lib/gemdiff/outdated_gem.rb', line 58 def repo @repo ||= RepoFinder.github_url(@name) end |
#repo? ⇒ Boolean
62 63 64 |
# File 'lib/gemdiff/outdated_gem.rb', line 62 def repo? repo end |
#set_versions(v_old, v_new) ⇒ Object
42 43 44 |
# File 'lib/gemdiff/outdated_gem.rb', line 42 def set_versions(v_old, v_new) @old_version, @new_version = old_new(v_old, v_new) end |