poise 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/poise/helpers/resource_subclass.rb +7 -0
- data/lib/poise/version.rb +1 -1
- data/test/spec/helpers/resource_subclass_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ea39bcec935e12ff80e73f172ac0b58b69f3458
|
4
|
+
data.tar.gz: 40a821e3aa86d2bd7327794e48be511d2c5a98ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0c2b8987b8059b5053ce852bf765887edf043f2c538478006d39ccf1ea1f2bb79228792a7140e167cca34863ca30a9a70de537171ee3fec2abc5b884bfa926
|
7
|
+
data.tar.gz: f9de6f4687a5b0188a796d49d425fc93c6a8eba9b2e77bda78e22af12ff7f2745c388ad273aecb496056e9da048f3e3c3896e5530adac750a06f276393997a7b
|
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,12 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
+
begin
|
18
|
+
require 'chef/chef_class'
|
19
|
+
rescue LoadError
|
20
|
+
# This space left intentionally blank, fallback is below.
|
21
|
+
end
|
22
|
+
|
17
23
|
require 'poise/error'
|
18
24
|
require 'poise/helpers/resource_name'
|
19
25
|
|
@@ -42,6 +48,7 @@ module Poise
|
|
42
48
|
node_maps['priority map'] = if defined?(Chef.provider_priority_map)
|
43
49
|
Chef.provider_priority_map
|
44
50
|
else
|
51
|
+
require 'chef/platform/provider_priority_map'
|
45
52
|
Chef::Platform::ProviderPriorityMap.instance.send(:priority_map)
|
46
53
|
end
|
47
54
|
# Patch anything in the descendants tracker.
|
data/lib/poise/version.rb
CHANGED
@@ -24,6 +24,7 @@ module PoiseTestSubclass
|
|
24
24
|
class Resource < Chef::Resource
|
25
25
|
include Poise
|
26
26
|
provides(:poise_test_subclass)
|
27
|
+
actions(:run)
|
27
28
|
end
|
28
29
|
class Provider < Chef::Provider
|
29
30
|
include Poise
|
@@ -32,6 +33,10 @@ module PoiseTestSubclass
|
|
32
33
|
(node.run_state[:really_did_run] ||= []) << new_resource.name
|
33
34
|
end
|
34
35
|
end
|
36
|
+
class Sub < Resource
|
37
|
+
provides(:poise_test_subclass_sub)
|
38
|
+
subclass_providers!
|
39
|
+
end
|
35
40
|
end
|
36
41
|
|
37
42
|
describe Poise::Helpers::ResourceSubclass do
|
@@ -63,6 +68,16 @@ describe Poise::Helpers::ResourceSubclass do
|
|
63
68
|
it { is_expected.to ChefSpec::Matchers::ResourceMatcher.new('poise_test_subclass_other_name', 'run', 'test2') }
|
64
69
|
it { expect(chef_run.node.run_state[:really_did_run]).to eq %w{test test2} }
|
65
70
|
end # /context with multiple resource names
|
71
|
+
|
72
|
+
context 'with a non-DSL subclass' do
|
73
|
+
before { step_into << :poise_test_subclass_sub }
|
74
|
+
recipe do
|
75
|
+
poise_test_subclass_sub 'test'
|
76
|
+
end
|
77
|
+
|
78
|
+
it { is_expected.to run_poise_test_subclass_sub('test') }
|
79
|
+
it { expect(chef_run.node.run_state[:really_did_run]).to eq %w{test} }
|
80
|
+
end # /context with a non-DSL subclass
|
66
81
|
end # /describe .subclass_providers!
|
67
82
|
|
68
83
|
describe '.subclass_resource_equivalents' do
|
@@ -83,6 +98,11 @@ describe Poise::Helpers::ResourceSubclass do
|
|
83
98
|
it { is_expected.to eq %i{poise_sub poise_test_subclass} }
|
84
99
|
end # /context with a subclass
|
85
100
|
|
101
|
+
context 'with a non-DSL subclass' do
|
102
|
+
let(:test_class) { PoiseTestSubclass::Sub }
|
103
|
+
it { is_expected.to eq %i{poise_test_subclass_sub poise_test_subclass} }
|
104
|
+
end # /context with a non-DSL subclass
|
105
|
+
|
86
106
|
context 'with an unpatched subclass' do
|
87
107
|
resource(:poise_sub2, parent: PoiseTestSubclass::Resource) do
|
88
108
|
provides(:poise_sub2)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Kantrowitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|