docker-env 1.2.1 → 1.3.0

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/VERSION +1 -1
  3. data/bin/docker-env +7 -6
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68b863358504e6004fc912bc71df145532f2c324
4
- data.tar.gz: 100cf43a69408689de2e64f466fd21f22bbddb1f
3
+ metadata.gz: eb048673013e7f2bd08c48fd3a1f1e2b535c7dc8
4
+ data.tar.gz: b50f1bec7b96b727b1166a37b0ab0c9a080ddeeb
5
5
  SHA512:
6
- metadata.gz: 0ded2b8fee23a021342043e1abc4443e14da0af84f7bb753e39f42e8e3aeb51966c8e5ca33fda3cecedaf5fb3425b3b2368bfb2c3441d92f38fa2ccc33c9d94b
7
- data.tar.gz: 729fefb43d32240dd6ffd98c9475005b31744059cb0b3c75d129ea2fc2de91f13ea07807fd001bfafa2c7cd7939794ed983dd30027bfa0579a48497af81efe41
6
+ metadata.gz: 3e323b83144cdd4bba4c22fdb7aeec62f0c376cc32bd7bcf5bd11f7d2fac90758b462365c0f5aee70e6f22ab34075d2c296e92999b118eb096deca9112f0acf2
7
+ data.tar.gz: 5c825a0d1e18596d8f205b1d136159a62e69521ccc6febae05d8644df79861a52f0b2bc021fd630d79e20f36c375c7ddb9b51dc9c62a6804a2e4d6a22ea803e1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.3.0
@@ -17,9 +17,9 @@ subcommand_option_handling :normal
17
17
  arguments :strict
18
18
  wrap_help_text :verbatim
19
19
 
20
- switch [:v, :verbose], desc: 'be more verbose'
21
- switch [:k, :kill], desc: 'quit docker if it is running'
22
- switch [:r, :restart], desc: 'stop and start docker around command'
20
+ switch %i[v verbose], desc: 'be more verbose'
21
+ switch %i[k kill], desc: 'quit docker if it is running'
22
+ switch %i[r restart], desc: 'stop and start docker around command'
23
23
 
24
24
  def name(f, options)
25
25
  options[:verbose] ? f : f.sub(/^.+Docker\.qcow2\./, '')
@@ -30,7 +30,8 @@ def current(options)
30
30
  end
31
31
 
32
32
  def tell_docker(what, options)
33
- cmd = %[osascript -e 'tell application "Docker" to #{what}']
33
+ # wrap in try because "open" generated an error which we can ignore
34
+ cmd = %[osascript -e 'try\ntell application "Docker" to #{what}\nend try']
34
35
  $stderr.puts cmd if options[:verbose]
35
36
  system(cmd)
36
37
  end
@@ -44,7 +45,7 @@ def running?(options)
44
45
  tell_docker('quit', options) if active && (options[:kill] || options[:restart])
45
46
 
46
47
  # wait for docker to quit
47
- while check_running do
48
+ while check_running
48
49
  $stderr.putc '.' if options[:verbose]
49
50
  sleep 1
50
51
  end
@@ -57,7 +58,7 @@ def running?(options)
57
58
  end
58
59
 
59
60
  post do |global_options, _command, _options, _args|
60
- tell_docker('activate', global_options) if global_options[:restart]
61
+ tell_docker('open', global_options) if global_options[:restart]
61
62
  end
62
63
 
63
64
  desc 'setup by moving Docker.qcow2 to "image_name" and linking back'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-env
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Frankel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-20 00:00:00.000000000 Z
11
+ date: 2017-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 2.6.8
119
+ rubygems_version: 2.6.12
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: A tool to switch docker for mac environments