Sha256: ca154c6ec8153fd1bc42a838cef78d499431c5064df530fe8c19da8539e89648

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module KeepUp
  # Interface to the version control system (only Git is supported).
  class VersionControl
    def initialize(runner:)
      @runner = runner
    end

    def commit_changes(dependency)
      @runner.run "git commit -am 'Update #{dependency.name} to version #{dependency.version}'"
    end

    def revert_changes
      @runner.run "git reset --hard"
    end

    def clean?
      @runner.run("git status -s") == ""
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
keep_up-0.9.0 lib/keep_up/version_control.rb