lib/keep_up/repository.rb in keep_up-0.3.0 vs lib/keep_up/repository.rb in keep_up-0.4.0
- old
+ new
@@ -1,17 +1,15 @@
-require_relative 'remote_index'
-
module KeepUp
# Picks updated versions for dependencies.
class Repository
- attr_reader :remote_index
+ attr_reader :index
- def initialize(remote_index: RemoteIndex.new)
- @remote_index = remote_index
+ def initialize(index:)
+ @index = index
end
def updated_dependency_for(dependency)
- candidates = remote_index.search(dependency)
+ candidates = index.search(dependency)
latest = candidates.sort_by(&:version).last
latest unless latest.version <= dependency.locked_version
end
end
end