Sha256: 0f358ab55b4f069ca4ad999be6e43f935abbc09f4a84d745fdec8291185813a6
Contents?: true
Size: 801 Bytes
Versions: 2
Compression:
Stored size: 801 Bytes
Contents
require_relative 'null_filter' module KeepUp # Apply potential updates to a Gemfile. class Updater attr_reader :bundle, :repository, :version_control, :filter def initialize(bundle:, repository:, version_control:, filter: NullFilter.new) @bundle = bundle @repository = repository @version_control = version_control @filter = filter end def run possible_updates.each do |update| if bundle.apply_updated_dependency update version_control.commit_changes update else version_control.revert_changes end end end def possible_updates bundle.direct_dependencies. select { |dep| filter.call dep }. map { |dep| repository.updated_dependency_for dep }.compact end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
keep_up-0.4.0 | lib/keep_up/updater.rb |
keep_up-0.3.0 | lib/keep_up/updater.rb |