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.
-
#gemfile_requirement ⇒ Object
Returns the value of attribute gemfile_requirement.
-
#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.
16 17 18 19 20 21 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 16 def initialize(**attrs) @vulnerable = nil @changelog_locator = ChangelogLocator.new attrs.each { |name, value| public_send(:"#{name}=", value) } end |
Instance Attribute Details
#changelog_uri ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 35 def changelog_uri return @changelog_uri if defined?(@changelog_uri) @changelog_uri = if (diff_url = build_git_diff_url) diff_url elsif (found_uri = rubygems_source? && locate_changelog_uri) found_uri 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 |
#gemfile_requirement ⇒ Object
Returns the value of attribute gemfile_requirement.
5 6 7 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 5 def gemfile_requirement @gemfile_requirement 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
14 15 16 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 14 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
14 15 16 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 14 def vulnerable=(value) @vulnerable = value end |
Instance Method Details
#git_version_changed? ⇒ Boolean
52 53 54 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 52 def git_version_changed? current_git_version && updated_git_version && current_git_version != updated_git_version end |
#rubygems_source? ⇒ Boolean
31 32 33 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 31 def rubygems_source? @rubygems_source end |
#semver_change ⇒ Object
23 24 25 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 23 def semver_change @semver_change ||= SemverChange.new(current_version, updated_version) end |
#vulnerable? ⇒ Boolean
27 28 29 |
# File 'lib/bundle_update_interactive/outdated_gem.rb', line 27 def vulnerable? @vulnerable end |