compat_resource 12.5.4 → 12.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -0
- data/files/lib/chef_compat/copied_from_chef/chef/property.rb +1 -0
- data/files/lib/chef_compat/copied_from_chef/chef/provider.rb +1 -0
- data/files/lib/chef_compat/copied_from_chef/chef/resource.rb +1 -0
- data/files/lib/chef_compat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5055fb4c5939e39fed2efe8055508ca4699cd2d
|
4
|
+
data.tar.gz: 64d8388632c86ae8b8450455c99fe2886b5fb617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3f74ade0040be9b6350ec17ff27d4f6aec9a1f62612036a3d2de76fdfc82bddedabd2ca6aeb19f3f7f1e1a51e68c9d62a2fc1ee5ea780f9ccd081ba488595f2
|
7
|
+
data.tar.gz: a93c59f0b0d9bef5014d76e578e23de7d85a1189380ed440e95a06169b0565bcac1db7433d7cc54bba54051f34b94fbb8f634fac6d19d0e1e212a8d41823ea03
|
data/Rakefile
CHANGED
@@ -101,6 +101,7 @@ task :update do
|
|
101
101
|
skip_until = /\A#{$1}end\s*$/
|
102
102
|
next
|
103
103
|
else
|
104
|
+
function = $2
|
104
105
|
# Keep everything inside a function no matter what it is
|
105
106
|
keep_until = /\A#{$1}end\s*$/
|
106
107
|
end
|
@@ -169,6 +170,11 @@ task :update do
|
|
169
170
|
line = PROCESS_LINES[file].call(line) if PROCESS_LINES[file]
|
170
171
|
|
171
172
|
output.puts line
|
173
|
+
|
174
|
+
# If this was the header for an initialize function, write out "super"
|
175
|
+
if function == 'initialize'
|
176
|
+
output.puts "super if defined?(::#{in_class[-1][:name]})"
|
177
|
+
end
|
172
178
|
end
|
173
179
|
# Close the ChefCompat module declaration from the top
|
174
180
|
output.puts "end"
|
@@ -88,6 +88,7 @@ class Chef < (defined?(::Chef) ? ::Chef : Object)
|
|
88
88
|
# is fully initialized.
|
89
89
|
#
|
90
90
|
def initialize(**options)
|
91
|
+
super if defined?(::Chef::Property)
|
91
92
|
options.each { |k,v| options[k.to_sym] = v if k.is_a?(String) }
|
92
93
|
|
93
94
|
# Replace name_attribute with name_property
|
@@ -5,6 +5,7 @@ module CopiedFromChef
|
|
5
5
|
class Chef < (defined?(::Chef) ? ::Chef : Object)
|
6
6
|
class Provider < (defined?(::Chef::Provider) ? ::Chef::Provider : Object)
|
7
7
|
def initialize(new_resource, run_context)
|
8
|
+
super if defined?(::Chef::Provider)
|
8
9
|
@new_resource = new_resource
|
9
10
|
@action = action
|
10
11
|
@current_resource = nil
|
@@ -7,6 +7,7 @@ require 'chef_compat/copied_from_chef/chef/resource/action_class'
|
|
7
7
|
class Chef < (defined?(::Chef) ? ::Chef : Object)
|
8
8
|
class Resource < (defined?(::Chef::Resource) ? ::Chef::Resource : Object)
|
9
9
|
def initialize(name, run_context=nil)
|
10
|
+
super if defined?(::Chef::Resource)
|
10
11
|
name(name) unless name.nil?
|
11
12
|
@run_context = run_context
|
12
13
|
@noop = nil
|