Module: Test::Drive::GitHelper
- Includes:
- Methadone::CLILogging, Methadone::SH
- Defined in:
- lib/test/drive/git_helper.rb
Instance Method Summary collapse
Instance Method Details
#create_patch(filename) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/test/drive/git_helper.rb', line 9 def create_patch filename sh 'git pull --rebase' res = sh 'git diff --binary origin/master' do |stdout| File.open(filename, 'w') { |f| f.write stdout } end unless res == 0 raise IOError.new 'Failed to create patch' end end |
#delete_patch(filename) ⇒ Object
21 22 23 |
# File 'lib/test/drive/git_helper.rb', line 21 def delete_patch filename File.delete filename end |
#git_push ⇒ Object
25 26 27 |
# File 'lib/test/drive/git_helper.rb', line 25 def git_push sh 'git push origin' end |