depl 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15687a80e9ac8e4666c3ac6903173add2ba28096
4
- data.tar.gz: bfe44d5ac3a5cd481166ff4baa7d5745fdb893da
3
+ metadata.gz: e1cb38f31f653b03313ae4a0c4a25d2a7c53f2b3
4
+ data.tar.gz: 64a7413dcf5b7aac926eb1fa8e011a72d49f7001
5
5
  SHA512:
6
- metadata.gz: 5997fee34089fab8c49049b9a5aad8907821e9539df276c42d45971cd68bccf54ee88d529a54631dfb1125e6f97223ca5fc3bbc8f13f4cf50151ad3b76894df5
7
- data.tar.gz: 8e45fee13a66726ae29438e49c15a14712ffd5b4e11e990f728990d7fe37cc4a2b359b71452f75f800399cdbfe8ca153452843c28daad5628f632e604e10e2a6
6
+ metadata.gz: a98dd6751dff5944284a84fb3b5bf86de51db6fce6a852d364fc700f5481a82fdb59f586fe76a712ff0ea4d32a4041337e44c09f074961e7a9535fa2c4f86764
7
+ data.tar.gz: 4352e7c75dd793035c2682de6c7b43ed8038fc5e6be7d35173c3e3cd56e67ce7864624b8d9f21d512c3f2a42ec40336f6d82c6c14c13da810026d68307cc8c1e
data/README.md CHANGED
@@ -27,6 +27,8 @@ Movable Ink uses Chef to push out new code, and Chef is set up to use environmen
27
27
 
28
28
  ## History
29
29
 
30
+ * _0.0.6_ - Use spawn() to ensure that $EDITOR properly opens to write tag message
31
+ * _0.0.5_ - Tag each deploy so that there is a history.
30
32
  * _0.0.4_ - Add --force and --quiet options; better help messages.
31
33
  * _0.0.3_ - Fixed yaml dependency.
32
34
  * _0.0.2_ - Updated gem description.
@@ -59,7 +59,7 @@ module Depl
59
59
 
60
60
  def remote_sha
61
61
  `git fetch #{origin}`
62
- sha = execute("git rev-parse -q --verify #{origin}/#{deploy_branch}")
62
+ sha = execute_output("git rev-parse -q --verify #{origin}/#{deploy_branch}")
63
63
  sha && sha.chomp || raise("missing remote sha for #{origin}/#{deploy_branch}")
64
64
  end
65
65
 
@@ -69,21 +69,21 @@ module Depl
69
69
 
70
70
  def local_sha
71
71
  rev = @options[:rev] || @config[:branch] || 'head'
72
- sha = execute("git rev-parse -q --verify #{rev}")
72
+ sha = execute_output("git rev-parse -q --verify #{rev}")
73
73
  sha && sha.chomp || raise("missing local sha: #{rev}")
74
74
  end
75
75
 
76
76
  def diff
77
- execute "git log --pretty=format:' %h %<(20)%an %ar\t %s' #{remote_sha}..#{local_sha}"
77
+ execute_output "git log --pretty=format:' %h %<(20)%an %ar\t %s' #{remote_sha}..#{local_sha}"
78
78
  end
79
79
 
80
80
  def reverse_diff
81
- execute "git log --pretty=format:' %h %<(20)%an %ar\t %s' #{local_sha}..#{remote_sha}"
81
+ execute_output "git log --pretty=format:' %h %<(20)%an %ar\t %s' #{local_sha}..#{remote_sha}"
82
82
  end
83
83
 
84
84
  def older_local_sha
85
85
  return false unless remote_sha
86
- !!execute("git merge-base --is-ancestor #{local_sha} #{remote_sha}")
86
+ !!execute_output("git merge-base --is-ancestor #{local_sha} #{remote_sha}")
87
87
  end
88
88
 
89
89
  def commit_count
@@ -92,9 +92,21 @@ module Depl
92
92
 
93
93
  protected
94
94
 
95
+ def execute_output(cmd)
96
+ rd, wr = IO.pipe
97
+
98
+ pid = spawn(cmd, out: wr, err: wr)
99
+ pid, status = Process.wait2(pid)
100
+
101
+ wr.close
102
+ status.exitstatus == 0 && rd.read
103
+ end
104
+
95
105
  def execute(cmd)
96
- output = `#{cmd}`
97
- $?.exitstatus == 0 && output
106
+ pid = spawn(cmd)
107
+ pid, status = Process.wait2(pid)
108
+
109
+ status.exitstatus == 0
98
110
  end
99
111
  end
100
112
  end
@@ -1,3 +1,3 @@
1
1
  module Depl
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: depl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Nutt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-01 00:00:00.000000000 Z
11
+ date: 2017-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline