dg 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dg/docker.rb +9 -3
  3. data/lib/dg/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1046c9e937f5b5bd562829da8815c495de75681a
4
- data.tar.gz: 6f0c35bc9ac501948bb1ac0a174f80ecc17b6427
3
+ metadata.gz: d54a7630e338fb23a616e729563b508007dcf3a8
4
+ data.tar.gz: 8e6462693033f4269257d4946874b58c7fa13923
5
5
  SHA512:
6
- metadata.gz: ec8a8ccd0430e36f83690f9925b40b04b5e583a26273a7504b55bebb382ff310e36a8757d0924941af45f84fd62331733960df9f027311da5665f187e3234585
7
- data.tar.gz: 8e69e2a120db6cf26697f0356196b5129bd07e0cc609e6ce8900c749c922e5b541c389c2f680e94cc767a1b61d78e86627ea8caa5f48b19cb20d325990c0d2a7
6
+ metadata.gz: 41d35b4af2f4f186c1a23f3056473e2783267098f2cc781898492104ae2118a06bf7293bad463356f7eb614366710594b3e2ca93b40805e824329e30a21290ac
7
+ data.tar.gz: 9e8c585f0659e82971c1b01473d30fa41491e6b200e9b7c4c97bfc33da135ac07a5a2c19d0d467544e639f8eb6496f11046e902ffdd3bb78fda68c836a0cc79b
data/lib/dg/docker.rb CHANGED
@@ -85,6 +85,12 @@ module DG
85
85
 
86
86
  private
87
87
 
88
+ def fig_binary
89
+ @@fig_binary_cached ||= %w(docker-compose fig).detect do |binary|
90
+ run_with_output(%(which #{binary}), false, return_hash = true)[:status_code] == 0
91
+ end
92
+ end
93
+
88
94
  def error!(e, step = "executing")
89
95
  STDERR.puts "An error occurred while #{step}: #{e.message}"
90
96
  exit 1
@@ -97,7 +103,7 @@ module DG
97
103
  begin
98
104
  buffer = ''
99
105
  PTY.spawn(sudo_command) do |stdin, stdout, pid|
100
- callback = capture ?
106
+ callback = (capture || return_hash) ?
101
107
  ->(line) {
102
108
  print line unless return_hash
103
109
  buffer << line
@@ -183,13 +189,13 @@ module DG
183
189
  end
184
190
 
185
191
  def run_tests
186
- run_with_output("fig -f #{FIG_GEN_PATH} run --rm test")
192
+ run_with_output("#{fig_binary} -f #{FIG_GEN_PATH} run --rm test")
187
193
  rescue => e
188
194
  error!(e, "running tests")
189
195
  end
190
196
 
191
197
  def run_app
192
- run_with_output("fig -f #{FIG_GEN_PATH} up -d web")
198
+ run_with_output("#{fig_binary} -f #{FIG_GEN_PATH} up -d web")
193
199
  end
194
200
 
195
201
  def debug_app
data/lib/dg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DG
2
- VERSION = '0.6.4'
2
+ VERSION = '0.6.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Malet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-26 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  DockerGo (DG)