all_images 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/all_images.gemspec +2 -2
- data/lib/all_images/app.rb +11 -8
- data/lib/all_images/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caf66d8b951b234a0c223aae8e0a34ec57680c59c4e336d72128ae94cf81427f
|
4
|
+
data.tar.gz: d57279b471c59a479e472adaf339e1549b6f3caadab8ade6277b8649733158dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d4b2ad103e5b6be87ebaaa489479042ac2a8f05cec5477eb8eb10f4ff6a2d4b17b70a98b5d43dcc624b995921b021263a3e649d7d629a676329b662942b122
|
7
|
+
data.tar.gz: ed8c42dbe74ab966ded63e764a67abc94447d12e18f142e54425191b01ca6154bce45b6c622bfc51ca255cfeb7cbe312c4ced8646e1f37d00f864b78e2e9003d
|
data/all_images.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: all_images 0.2.
|
2
|
+
# stub: all_images 0.2.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "all_images".freeze
|
6
|
-
s.version = "0.2.
|
6
|
+
s.version = "0.2.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
data/lib/all_images/app.rb
CHANGED
@@ -10,15 +10,19 @@ class AllImages::App
|
|
10
10
|
|
11
11
|
def initialize(args)
|
12
12
|
@args = args.dup
|
13
|
-
@command =
|
13
|
+
@command = pick_command
|
14
14
|
end
|
15
15
|
|
16
16
|
def run
|
17
17
|
result = 0
|
18
18
|
@config = load_config or return 23
|
19
19
|
|
20
|
-
|
20
|
+
case @command
|
21
|
+
when 'ls'
|
21
22
|
puts Array(@config['images']).map(&:first)
|
23
|
+
when 'help'
|
24
|
+
commands = %w[ ls help run debug run_all ].sort
|
25
|
+
puts "Usage: #{File.basename($0)} #{commands * ?|} IMAGE"
|
22
26
|
else
|
23
27
|
Array(@config['images']).each do |image, script|
|
24
28
|
case @command
|
@@ -54,21 +58,20 @@ class AllImages::App
|
|
54
58
|
sh 'docker rm -f all_images >/dev/null'
|
55
59
|
end
|
56
60
|
|
57
|
-
def
|
58
|
-
case command = @args.
|
59
|
-
when nil
|
61
|
+
def pick_command
|
62
|
+
case command = @args.shift
|
63
|
+
when 'run_all', nil
|
60
64
|
'run_all'
|
61
65
|
when 'ls'
|
62
|
-
@args.shift
|
63
66
|
'ls'
|
64
67
|
when 'run'
|
65
|
-
@args.shift
|
66
68
|
@selected = @args.shift or fail "Usage: #{File.basename($0)} #{command} IMAGE"
|
67
69
|
'run_selected'
|
68
70
|
when 'debug'
|
69
|
-
@args.shift
|
70
71
|
@selected = @args.shift or fail "Usage: #{File.basename($0)} #{command} IMAGE"
|
71
72
|
'debug_selected'
|
73
|
+
when 'help'
|
74
|
+
'help'
|
72
75
|
end
|
73
76
|
end
|
74
77
|
|
data/lib/all_images/version.rb
CHANGED