gx 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/gx-pull-check +21 -5
  2. data/lib/gx.rb +1 -1
  3. metadata +4 -4
@@ -3,6 +3,7 @@
3
3
  require 'pathname'
4
4
 
5
5
  require 'gx/enhance'
6
+ require 'digest/sha1'
6
7
 
7
8
  STDOUT.sync = true
8
9
 
@@ -15,24 +16,38 @@ current_branch = head.name
15
16
  url = ARGV.shift
16
17
  cmd = ARGV.shift || "rake"
17
18
 
19
+ puts "Performing pull check on '#{url}'"
20
+
21
+ url += ".patch"
22
+
23
+ patch = File.join ENV['TMPDIR'], "pull-check-#{Digest::SHA1.hexdigest(url)}"
24
+
25
+ puts "Step 1: Downloading the pull request..."
26
+ system "curl -#L -o #{patch} '#{url}'"
27
+
28
+ if $?.exitstatus != 0
29
+ puts "Error downloading #{url}"
30
+ exit 1
31
+ end
32
+
33
+ puts "Step 2: Apply the pull request..."
18
34
  repo.git.branch({}, "gx-pull-check")
19
35
  repo.git.checkout({}, "gx-pull-check")
20
36
 
21
- puts "Performing pull check on '#{url}'"
22
-
23
- puts "Step 1: Apply the pull request..."
24
- system "hub am '#{url}'"
37
+ system "git am #{patch}"
25
38
 
26
39
  if $?.exitstatus != 0
40
+ File.unlink patch
27
41
  puts "Error applying the pull request, leaving you in the branch"
28
42
  exit 1
29
43
  end
30
44
 
31
- puts "Step 2: run '#{cmd}'..."
45
+ puts "Step 3: run '#{cmd}'..."
32
46
 
33
47
  system cmd
34
48
 
35
49
  if $?.exitstatus != 0
50
+ File.unlink patch
36
51
  puts "Error running test command, leaving you in the branch"
37
52
  exit 1
38
53
  end
@@ -43,3 +58,4 @@ puts "Everything ran fine, feel free to merge the pull request!"
43
58
  repo.git.checkout({}, current_branch)
44
59
  repo.git.branch({:D => true}, "gx-pull-check")
45
60
 
61
+ File.unlink patch
data/lib/gx.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Gx
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gx
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 1.2.0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Evan Phoenix
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-21 00:00:00 Z
18
+ date: 2011-12-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: grit