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
| 18 19 20 | # File 'lib/keep_up/version_control.rb', line 18 def clean? @runner.run("git status -s") == "" end | 
#commit_changes(dependency) ⇒ Object
| 10 11 12 | # File 'lib/keep_up/version_control.rb', line 10 def commit_changes(dependency) @runner.run "git commit -am 'Auto-update #{dependency.name} to #{dependency.version}'" end | 
#revert_changes ⇒ Object
| 14 15 16 | # File 'lib/keep_up/version_control.rb', line 14 def revert_changes @runner.run "git reset --hard" end |