Class: BundleUpdateInteractive::OutdatedGem
- Inherits:
-
Object
- Object
- BundleUpdateInteractive::OutdatedGem
- Defined in:
- lib/bundle_update_interactive/outdated_gem.rb
Instance Attribute Summary collapse
- #changelog_uri ⇒ Object
-
#current_git_version ⇒ Object
Returns the value of attribute current_git_version.
-
#current_version ⇒ Object
Returns the value of attribute current_version.
-
#gemfile_groups ⇒ Object
Returns the value of attribute gemfile_groups.
-
#git_source_uri ⇒ Object
Returns the value of attribute git_source_uri.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rubygems_source ⇒ Object
writeonly
Sets the attribute rubygems_source.
-
#updated_git_version ⇒ Object
Returns the value of attribute updated_git_version.
-
#updated_version ⇒ Object
Returns the value of attribute updated_version.
-
#vulnerable ⇒ Object
writeonly
Sets the attribute vulnerable.
Instance Method Summary collapse
- #git_version_changed? ⇒ Boolean
-
#initialize(**attrs) ⇒ OutdatedGem
constructor
A new instance of OutdatedGem.
- #rubygems_source? ⇒ Boolean
- #semver_change ⇒ Object
- #vulnerable? ⇒ Boolean
Constructor Details
#initialize(**attrs) ⇒ OutdatedGem
Returns a new instance of OutdatedGem.
15 16 17 18 19 20 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 15 def initialize(**attrs) @vulnerable = nil @changelog_locator = ChangelogLocator.new attrs.each { |name, value| public_send(:"#{name}=", value) } end |
Instance Attribute Details
#changelog_uri ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 34 def changelog_uri return @changelog_uri if defined?(@changelog_uri) @changelog_uri = if (diff_url = build_git_diff_url) diff_url elsif rubygems_source? changelog_locator.find_changelog_uri(name: name, version: updated_version.to_s) else begin Gem::Specification.find_by_name(name)&.homepage rescue Gem::MissingSpecError nil end end end |
#current_git_version ⇒ Object
Returns the value of attribute current_git_version.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def current_git_version @current_git_version end |
#current_version ⇒ Object
Returns the value of attribute current_version.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def current_version @current_version end |
#gemfile_groups ⇒ Object
Returns the value of attribute gemfile_groups.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def gemfile_groups @gemfile_groups end |
#git_source_uri ⇒ Object
Returns the value of attribute git_source_uri.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def git_source_uri @git_source_uri end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def name @name end |
#rubygems_source=(value) ⇒ Object (writeonly)
Sets the attribute rubygems_source
13 14 15 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 13 def rubygems_source=(value) @rubygems_source = value end |
#updated_git_version ⇒ Object
Returns the value of attribute updated_git_version.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def updated_git_version @updated_git_version end |
#updated_version ⇒ Object
Returns the value of attribute updated_version.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def updated_version @updated_version end |
#vulnerable=(value) ⇒ Object (writeonly)
Sets the attribute vulnerable
13 14 15 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 13 def vulnerable=(value) @vulnerable = value end |
Instance Method Details
#git_version_changed? ⇒ Boolean
51 52 53 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 51 def git_version_changed? current_git_version && updated_git_version && current_git_version != updated_git_version end |
#rubygems_source? ⇒ Boolean
30 31 32 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 30 def rubygems_source? @rubygems_source end |
#semver_change ⇒ Object
22 23 24 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 22 def semver_change @semver_change ||= SemverChange.new(current_version, updated_version) end |
#vulnerable? ⇒ Boolean
26 27 28 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 26 def vulnerable? @vulnerable end |