patchr 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/patchr +7 -3
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.4
data/bin/patchr CHANGED
@@ -27,7 +27,7 @@ def find_attachment(ticket_id)
27
27
  choice = STDIN.gets.to_i - 1
28
28
  attachments[choice]
29
29
  else
30
- attachment.first
30
+ attachments.first
31
31
  end
32
32
  end
33
33
 
@@ -57,11 +57,15 @@ elsif command == "apply"
57
57
 
58
58
  # Create local branch and run tests
59
59
  puts "Applying #{attachment.filename} of issue #{ticket_id}"
60
- `git checkout master`
60
+ puts "Updating master"
61
+ system(`git checkout master`)
61
62
  `git pull origin master`
62
- `git checkout -b #{ticket_id}-#{attachment.filename}`
63
+ branch_name = "#{ticket_id}-#{attachment.filename}"
64
+ `git checkout -b #{branch_name}`
63
65
  patch_file = retrieve_patch_file(ticket_id, attachment)
66
+ puts patch_file
64
67
  `git apply #{patch_file}`
68
+ `git commit -am "Applied patch #{branch_name}"`
65
69
  puts "patch apply start running tests"
66
70
  else
67
71
  if command.blank?
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jeroen van Dijk