Class: BundleUpdateInteractive::LockfileEntry
- Inherits:
-
Object
- Object
- BundleUpdateInteractive::LockfileEntry
- Defined in:
- lib/bundle_update_interactive/lockfile_entry.rb
Instance Attribute Summary collapse
-
#exact_dependencies ⇒ Object
readonly
Returns the value of attribute exact_dependencies.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #exact_requirement? ⇒ Boolean
- #git_source? ⇒ Boolean
- #git_source_uri ⇒ Object
- #git_version ⇒ Object
-
#initialize(spec, exact_dependencies, exact_requirement) ⇒ LockfileEntry
constructor
A new instance of LockfileEntry.
- #name ⇒ Object
- #older_than?(updated_entry) ⇒ Boolean
- #rubygems_source? ⇒ Boolean
- #version ⇒ Object
Constructor Details
#initialize(spec, exact_dependencies, exact_requirement) ⇒ LockfileEntry
Returns a new instance of LockfileEntry.
7 8 9 10 11 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 7 def initialize(spec, exact_dependencies, exact_requirement) @spec = spec @exact_dependencies = exact_dependencies @exact_requirement = exact_requirement end |
Instance Attribute Details
#exact_dependencies ⇒ Object (readonly)
Returns the value of attribute exact_dependencies.
5 6 7 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 5 def exact_dependencies @exact_dependencies end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
5 6 7 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 5 def spec @spec end |
Instance Method Details
#exact_requirement? ⇒ Boolean
31 32 33 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 31 def exact_requirement? @exact_requirement end |
#git_source? ⇒ Boolean
43 44 45 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 43 def git_source? !!git_version end |
#git_source_uri ⇒ Object
39 40 41 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 39 def git_source_uri spec.source.uri if git_source? end |
#git_version ⇒ Object
35 36 37 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 35 def git_version spec.git_version&.strip end |
#name ⇒ Object
13 14 15 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 13 def name spec.name end |
#older_than?(updated_entry) ⇒ Boolean
21 22 23 24 25 26 27 28 29 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 21 def older_than?(updated_entry) return false if updated_entry.nil? if git_source? && updated_entry.git_source? version <= updated_entry.version && git_version != updated_entry.git_version else version < updated_entry.version end end |
#rubygems_source? ⇒ Boolean
47 48 49 50 51 52 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 47 def rubygems_source? return false if git_source? source = spec.source source.respond_to?(:remotes) && source.remotes.map(&:to_s).include?("https://rubygems.org/") end |
#version ⇒ Object
17 18 19 |
# File 'lib/bundle_update_interactive/lockfile_entry.rb', line 17 def version spec.version end |