Module: Test::Drive::GitHelper

Includes:
Methadone::SH
Defined in:
lib/test/drive/git_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_patch(filename) ⇒ Object



8
9
10
11
12
13
# File 'lib/test/drive/git_helper.rb', line 8

def create_patch filename
  res = sh "git pull --rebase && git diff --binary origin > #{filename}"
  unless res == 0
    raise IOError.new 'Failed to create patch'
  end
end

#delete_patch(filename) ⇒ Object



15
16
17
# File 'lib/test/drive/git_helper.rb', line 15

def delete_patch filename
  `rm #{filename}`
end

#git_pushObject



19
20
21
# File 'lib/test/drive/git_helper.rb', line 19

def git_push
  `git push origin master`
end