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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de05a97c00f24025bb2e3128230abdbd1c33bbc563cdd3bf7818b24008a784b6
4
- data.tar.gz: 609415cdec20cc1b986eebcdb977cdb795c9aa7a5fa82a44107a541ec4dcf5d6
3
+ metadata.gz: caf66d8b951b234a0c223aae8e0a34ec57680c59c4e336d72128ae94cf81427f
4
+ data.tar.gz: d57279b471c59a479e472adaf339e1549b6f3caadab8ade6277b8649733158dd
5
5
  SHA512:
6
- metadata.gz: 69ebf0b5e2b84c6bb3ab86e56f36016cd4152c3def0e63488bfff6ae3b0e234f50b5ddf77ee97549ca2be26dfd870af521d2aa71a968a47b795203250fa80a53
7
- data.tar.gz: 3bee4984a3b063ac369da24d24c0d92a13185b5c76df9c0bd0c61aa2a8257e3fbd23c6ee09d5e07a3889d387fa7fcafabb9b237926cf5acf1980558d2064c6f5
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.0 ruby lib
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.0"
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]
@@ -10,15 +10,19 @@ class AllImages::App
10
10
 
11
11
  def initialize(args)
12
12
  @args = args.dup
13
- @command = determine_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
- if @command == 'ls'
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 determine_command
58
- case command = @args.first
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
 
@@ -1,6 +1,6 @@
1
1
  module AllImages
2
2
  # AllImages version
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: all_images
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank