chef-zero 4.2.1 → 4.2.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: a494204cfb5a14c3b259ba81661b4e618fbf88d7
4
- data.tar.gz: cbbffbf9c1b738694c84975a51fb37965f0d3fb6
3
+ metadata.gz: 1b4a6e710f90e47913be43c72b9cc0452443b3d8
4
+ data.tar.gz: ce7a0c64ab54a3878aee472b1ad4b9bbd27212a4
5
5
  SHA512:
6
- metadata.gz: ddd3f8df7cb10711dc9098075704dbf4713fd99e035a83739bcaa4b9f463b57ffb6c9c40b70f473f3c9299894b7ff3f457b4721c10c3b27e5abd520b4d4b1314
7
- data.tar.gz: b0ce1891ade2af25515236d244fb37e5f4b496909719c3a8e2793a97e8a16ef7c006c5bc369161fd6e34ef142547a32cbe9b588af0492dea6c47ec33609511f4
6
+ metadata.gz: 9304111f0ee34e491f77e3846efc83e8181fcb8bdf286bff506c088f1cb9601614537ee1ae12b1b4b07932939e81253d1638cb733b650c0d21e4ef3c936363bc
7
+ data.tar.gz: dde7e1304a4a52d2ccfcc5a0e124038d5cc93d9c03eeeaf6d837514245fd8e529148329cfb570d19e6cd93a14e5c72d298b4e743e6e3f2d1505573e8ebc19ae3
@@ -46,23 +46,25 @@ module ChefZero
46
46
  extend WhenTheChefServerClassMethods
47
47
  include WhenTheChefServerInstanceMethods
48
48
 
49
+ @@chef_server_options = { port: 8900, signals: false, log_requests: true, server_scope: :each }
50
+
49
51
  def self.chef_server_options
50
52
  @@chef_server_options
51
53
  end
54
+
52
55
  def chef_server_options
53
56
  self.class.chef_server_options
54
57
  end
55
58
 
56
- @@chef_server_options = { port: 8900, signals: false, log_requests: true, server_scope: :each }
57
- chef_server_options = self.chef_server_options
58
- chef_server_options = chef_server_options.merge(chef_zero_opts) if self.respond_to?(:chef_zero_opts)
59
- chef_server_options = chef_server_options.merge(tags.last) if tags.last.is_a?(Hash)
60
-
61
59
  old_chef_server_url = nil
62
60
  old_node_name = nil
63
61
  old_client_key = nil
64
62
 
65
63
  before chef_server_options[:server_scope] do
64
+ chef_server_options = self.chef_server_options
65
+ chef_server_options = chef_server_options.merge(chef_zero_opts) if self.respond_to?(:chef_zero_opts)
66
+ chef_server_options = chef_server_options.merge(tags.last) if tags.last.is_a?(Hash)
67
+
66
68
  Log.debug("Starting Chef server with options #{chef_server_options}")
67
69
 
68
70
  ChefZero::RSpec.set_server_options(chef_server_options)
@@ -33,6 +33,10 @@ module ChefZero
33
33
  instance.request(port, request_env)
34
34
  end
35
35
 
36
+ def self.server_on_port(port)
37
+ instance.server_on_port(port)
38
+ end
39
+
36
40
  MUTEX = Mutex.new
37
41
 
38
42
  include Singleton
@@ -67,6 +71,10 @@ module ChefZero
67
71
  @servers_by_port.key?(port)
68
72
  end
69
73
 
74
+ def server_on_port(port)
75
+ @servers_by_port[port]
76
+ end
77
+
70
78
  def deregister(port)
71
79
  MUTEX.synchronize do
72
80
  @servers_by_port.delete(port)
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '4.2.1'
2
+ VERSION = '4.2.2'
3
3
  end
@@ -14,6 +14,11 @@ describe "Socketless Mode" do
14
14
  expect(server_map).to have_server_on_port(8889)
15
15
  end
16
16
 
17
+ it "retrieves a server by port" do
18
+ server_map.register_port(8889, server)
19
+ expect(ChefZero::SocketlessServerMap.server_on_port(8889)).to eq(server)
20
+ end
21
+
17
22
  context "when a no-listen server is registered" do
18
23
 
19
24
  let!(:port) { server_map.register_no_listen_server(server) }
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: 4.2.1
4
+ version: 4.2.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: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -239,9 +239,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  version: '0'
240
240
  requirements: []
241
241
  rubyforge_project:
242
- rubygems_version: 2.4.2
242
+ rubygems_version: 2.4.4
243
243
  signing_key:
244
244
  specification_version: 4
245
245
  summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing
246
246
  and solo setup purposes
247
247
  test_files: []
248
+ has_rdoc: