chef-zero 1.5 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/chef-zero CHANGED
@@ -20,6 +20,10 @@ OptionParser.new do |opts|
20
20
  options[:port] = value
21
21
  end
22
22
 
23
+ opts.on("--socket PATH", String, "Unix socket path to listen on") do |value|
24
+ options[:socket] = value
25
+ end
26
+
23
27
  opts.on("--[no-]generate-keys", "Whether to generate actual keys or fake it (faster). Default: false.") do |value|
24
28
  options[:generate_real_keys] = value
25
29
  end
@@ -36,7 +36,7 @@ module ChefZero
36
36
  file = filename(directory, 'metadata.rb') || "(#{name}/metadata.rb)"
37
37
  metadata.instance_eval(read_file(directory, 'metadata.rb'), file)
38
38
  rescue
39
- ChefZero::Log.error("Error loading cookbook #{name}: #{$!}\n#{$!.backtrace}")
39
+ ChefZero::Log.error("Error loading cookbook #{name}: #{$!}\n #{$!.backtrace.join("\n ")}")
40
40
  end
41
41
  elsif has_child(directory, 'metadata.json')
42
42
  metadata.from_json(read_file(directory, 'metadata.json'))
@@ -68,8 +68,8 @@ module ChefZero
68
68
  def initialize(cookbook)
69
69
  self.name(cookbook.name)
70
70
  self.recipes(cookbook.fully_qualified_recipe_names)
71
- %w(dependencies supports recommendations suggestions conflicting providing replacing recipes).each do |cookbook_arg|
72
- self[cookbook_arg.to_sym] = Hashie::Mash.new
71
+ %w(attributes grouping dependencies supports recommendations suggestions conflicting providing replacing recipes).each do |hash_arg|
72
+ self[hash_arg.to_sym] = Hashie::Mash.new
73
73
  end
74
74
  end
75
75
 
@@ -60,6 +60,7 @@ module ChefZero
60
60
  DEFAULT_OPTIONS = {
61
61
  :host => '127.0.0.1',
62
62
  :port => 8889,
63
+ :socket => nil,
63
64
  :log_level => :info,
64
65
  :generate_real_keys => true
65
66
  }.freeze
@@ -72,7 +73,12 @@ module ChefZero
72
73
  ChefZero::Log.level = options[:log_level].to_sym
73
74
 
74
75
  @server = Puma::Server.new(make_app, Puma::Events.new(STDERR, STDOUT))
75
- @server.add_tcp_listener(options[:host], options[:port])
76
+ if options[:socket]
77
+ @server.add_unix_listener(options[:socket])
78
+ else
79
+ @server.add_tcp_listener(options[:host], options[:port])
80
+ end
81
+
76
82
 
77
83
  @data_store = options[:data_store] || DataStore::MemoryStore.new
78
84
  end
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '1.5'
2
+ VERSION = '1.5.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-12 00:00:00.000000000 Z
12
+ date: 2013-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: puma