caterer 1.1.0 → 1.2.0

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: 2bc681c51ec2487b11cdc0160e22b21679127bbc
4
- data.tar.gz: 25f555f407bd57f2340543d6bd61d6e08af06622
3
+ metadata.gz: 0b3147ba0fe11638b59e9868a8d4acd806f26c77
4
+ data.tar.gz: 976a1d58307350bfb790500a54b118fbf88b4388
5
5
  SHA512:
6
- metadata.gz: b531a7470042d3786d80b1e39f6bde48702b37dae7b0fa77f5441eb0182a197b6a6d5a0a7e352804e373a64475816ea76f5b84d33a9ff5d25d2c8b28d223487d
7
- data.tar.gz: 7efefe14acc39795da9880f9eab145e12c3ce347e8ceb7841ac9243b710b7e3370f07bb5bb1cb6aa232c53800f16a761a90f528b631d2e4bdfc5830f680dbdde
6
+ metadata.gz: f5aa87a973e936714fe87065ee3ac861c3ceeb0f7de726b00bf2b9f5989c57ebef776fb31989352c99551710d536d3ee81aec5820410b4f3fb65f7203c5a3294
7
+ data.tar.gz: 04c695725ef3e98cb235f974a7c2be6e80107690e6ba65c9a6fcb4fce96b9a929254053543a311a71dc31deda9ad0c47bb81f6d7a3400040af57f942cba434f8
@@ -1,5 +1,7 @@
1
1
  Caterer.configure do |config|
2
2
 
3
+ config.default_command = 'provision'
4
+
3
5
  config.provisioner.default_engine = :chef_solo
4
6
 
5
7
  end
@@ -29,11 +29,20 @@ module Caterer
29
29
  return 0
30
30
  end
31
31
 
32
- command_class = Caterer.commands.get(@sub_command.to_sym) if @sub_command
33
- if !command_class || !@sub_command
32
+ if !@sub_command
34
33
  help
35
34
  return 0
35
+ end
36
+
37
+ begin
38
+ command_class = Caterer.commands.get(@sub_command.to_sym) || raise
39
+ rescue
40
+ # didn't understand the sub-command, let's run our default
41
+ @sub_args.unshift @sub_command
42
+ @sub_command = @env.config.default_command
43
+ retry
36
44
  end
45
+
37
46
  @logger.debug("Invoking command class: #{command_class} #{@sub_args.inspect}")
38
47
 
39
48
  # Initialize and execute the command class, returning the exit status.
@@ -80,7 +80,7 @@ module Caterer
80
80
  opts[:pass] = options[:pass] || member.password || group.password
81
81
  opts[:host] = options[:host] || member.host
82
82
  opts[:port] = options[:port] || member.port
83
- opts[:images] = image_list(options) || member.images || group.images
83
+ opts[:images] = image_list(options) || member.images || group.images || [:default]
84
84
  opts[:key] = options[:key] || member.key || group.key
85
85
 
86
86
  opts[:data] = begin
@@ -3,7 +3,7 @@ module Caterer
3
3
  class Base
4
4
 
5
5
  attr_reader :images, :groups
6
- attr_accessor :dest_dir
6
+ attr_accessor :dest_dir, :default_command
7
7
 
8
8
  def initialize
9
9
  @images = {}
@@ -6,12 +6,12 @@ module Caterer
6
6
 
7
7
  def initialize(name=nil)
8
8
  @name = name
9
- @images = []
10
9
  @members = {}
11
10
  @data = {}
12
11
  end
13
12
 
14
13
  def add_image(image)
14
+ @images ||= []
15
15
  @images << image
16
16
  end
17
17
 
@@ -9,5 +9,10 @@ module Caterer
9
9
  @data = {}
10
10
  end
11
11
 
12
+ def add_image(image)
13
+ @images ||= []
14
+ @images << image
15
+ end
16
+
12
17
  end
13
18
  end
@@ -1,3 +1,3 @@
1
1
  module Caterer
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caterer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Flint
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-04 00:00:00.000000000 Z
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log4r