chef-zero 1.7.1 → 1.7.2

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: 13b5f1b8b65f66c0f47d494f444c9488750ed83e
4
- data.tar.gz: 929a8f003e5f5b93fd3b245637b9934bee28bce7
3
+ metadata.gz: 0dc5c43b56067f314638042d649640166f83afde
4
+ data.tar.gz: c4dfa634c2d1a8293f19a890357f61d9419026c1
5
5
  SHA512:
6
- metadata.gz: 84035bcef117adc8873de173e81adfb329a84fdf3860aed896617924447d36d87be09aa4b5973778636c22346baefe5958123d0360f55f18becd9523a899b35c
7
- data.tar.gz: 3d725c50bc7c135e16152784180aed5c9c6fd76d08a6d6a20a2a0238877ef3688ece4843e12557a1a9340a74e44a1f8e3b9f606dc5481f6edd1a57972579ad48
6
+ metadata.gz: 51cd4eea5333d328bfae4577e3a69aa02d8b5f7ca92308954eaac265f77a851d4fd9c3df3e7c0243e74a026fc6c2bbcf25df6b4f43d0d14829f0e07bc2bd518f
7
+ data.tar.gz: 2fd500a4c7e70b64a99e3cfaca2f717190358944eaf3830689d51a030509cdccdb40cf4bc944b2ebe5422c1030cd3c953205fa6df71613068cb491092b978873
@@ -26,9 +26,20 @@ module ChefZero
26
26
  def when_the_chef_server(description, *tags, &block)
27
27
  context "When the Chef server #{description}", *tags do
28
28
  before :each do
29
+
29
30
  unless ChefZero::RSpec.server
31
+ default_opts = {:port => 8889, :signals => false, :log_requests => true}
32
+ server_opts = if self.respond_to?(:chef_zero_opts)
33
+ default_opts.merge(chef_zero_opts)
34
+ else
35
+ default_opts
36
+ end
37
+
38
+ # TODO: can this be logged easily?
39
+ # pp :zero_opts => server_opts
40
+
30
41
  # Set up configuration so that clients will point to the server
31
- ChefZero::RSpec.server = ChefZero::Server.new(:port => 8889, :signals => false, :log_requests => true)
42
+ ChefZero::RSpec.server = ChefZero::Server.new(server_opts)
32
43
  ChefZero::RSpec.client_key = Tempfile.new(['chef_zero_client_key', '.pem'])
33
44
  ChefZero::RSpec.client_key.write(ChefZero::PRIVATE_KEY)
34
45
  ChefZero::RSpec.client_key.close
@@ -69,7 +69,8 @@ module ChefZero
69
69
  def initialize(options = {})
70
70
  options = DEFAULT_OPTIONS.merge(options)
71
71
  @options = options
72
- @url = "http://#{options[:host]}:#{options[:port]}"
72
+ uri_safe_host = options[:host].include?(":") ? "[#{options[:host]}]" : options[:host]
73
+ @url = "http://#{uri_safe_host}:#{options[:port]}"
73
74
  @generate_real_keys = options[:generate_real_keys]
74
75
 
75
76
  ChefZero::Log.level = options[:log_level].to_sym
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '1.7.1'
2
+ VERSION = '1.7.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-03 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log