Class: KeepUp::Repository
- Inherits:
-
Object
- Object
- KeepUp::Repository
- Defined in:
- lib/keep_up/repository.rb
Overview
Picks updated versions for dependencies.
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(index:) ⇒ Repository
constructor
A new instance of Repository.
- #updated_dependency_for(dependency) ⇒ Object
Constructor Details
#initialize(index:) ⇒ Repository
Returns a new instance of Repository.
6 7 8 |
# File 'lib/keep_up/repository.rb', line 6 def initialize(index:) @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
4 5 6 |
# File 'lib/keep_up/repository.rb', line 4 def index @index end |
Instance Method Details
#updated_dependency_for(dependency) ⇒ Object
10 11 12 13 14 |
# File 'lib/keep_up/repository.rb', line 10 def updated_dependency_for(dependency) candidates = index.search(dependency) latest = candidates.sort_by(&:version).last latest unless latest.version <= dependency.locked_version end |