Class: KeepUp::VersionControl
- Inherits:
-
Object
- Object
- KeepUp::VersionControl
- Defined in:
- lib/keep_up/version_control.rb
Overview
Interface to the version control system (only Git is supported).
Instance Method Summary collapse
- #clean? ⇒ Boolean
- #commit_changes(dependency) ⇒ Object
-
#initialize(runner:) ⇒ VersionControl
constructor
A new instance of VersionControl.
- #revert_changes ⇒ Object
Constructor Details
#initialize(runner:) ⇒ VersionControl
Returns a new instance of VersionControl.
6 7 8 |
# File 'lib/keep_up/version_control.rb', line 6 def initialize(runner:) @runner = runner end |
Instance Method Details
#clean? ⇒ Boolean
19 20 21 |
# File 'lib/keep_up/version_control.rb', line 19 def clean? @runner.run("git status -s") == "" end |
#commit_changes(dependency) ⇒ Object
10 11 12 13 |
# File 'lib/keep_up/version_control.rb', line 10 def commit_changes(dependency) = "Update #{dependency.name} to version #{dependency.version}" @runner.run "git commit -am '#{}'" end |
#revert_changes ⇒ Object
15 16 17 |
# File 'lib/keep_up/version_control.rb', line 15 def revert_changes @runner.run "git reset --hard" end |