Class: SafeUpdate::GitRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/safe_update/git_repo.rb

Instance Method Summary collapse

Instance Method Details

#commit_gemfile_lock(message) ⇒ Object



17
18
19
20
# File 'lib/safe_update/git_repo.rb', line 17

def commit_gemfile_lock(message)
  `git add Gemfile.lock`
  `git commit -m '#{message}'`
end

#discard_local_changesObject



13
14
15
# File 'lib/safe_update/git_repo.rb', line 13

def discard_local_changes
  `git reset HEAD --hard`
end

#perform_safety_checksObject



8
9
10
11
# File 'lib/safe_update/git_repo.rb', line 8

def perform_safety_checks
  check_for_staged_changes
  check_for_gemfile_lock_changes
end

#pushObject



22
23
24
# File 'lib/safe_update/git_repo.rb', line 22

def push
  `git push`
end