Sha256: c3fc0df9eebf81beba69ff13dfad998e9d5578fd54fe761ce44e64159c807d9f

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

require_relative 'remote_index'

module KeepUp
  # Picks updated versions for dependencies.
  class Repository
    attr_reader :remote_index

    def initialize(remote_index: RemoteIndex.new)
      @remote_index = remote_index
    end

    def updated_dependency_for(dependency)
      candidates = remote_index.search(dependency)
      latest = candidates.sort_by(&:version).last
      latest unless latest.version <= dependency.locked_version
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
keep_up-0.3.0 lib/keep_up/repository.rb
keep_up-0.2.0 lib/keep_up/repository.rb