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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c65b6dd796aa308e3cb4db2733903a94e2618cc1
4
- data.tar.gz: 9c1e1cd5756b69b3fad0c2c7a85a9708d8fefbfc
3
+ metadata.gz: e5055fb4c5939e39fed2efe8055508ca4699cd2d
4
+ data.tar.gz: 64d8388632c86ae8b8450455c99fe2886b5fb617
5
5
  SHA512:
6
- metadata.gz: a392077b5c71bf0bd7b039b6f09372038ee39d3f4e7bd076331c14c650b499c86727c626f7400762f6ffd6ea6dda01e710f904b6cd52908a6173ebd509336c6d
7
- data.tar.gz: 5b1a176af3a6c81475d3a31e71c71d42fc5bce51683cbdfabc91f8d896696676a857329fbebad97f3c3546a6d1a561b98db522eb720f7baa036b00555685b609
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
@@ -1,3 +1,3 @@
1
1
  module ChefCompat
2
- VERSION = '12.5.4' if !defined?(VERSION)
2
+ VERSION = '12.5.5' if !defined?(VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compat_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.5.4
4
+ version: 12.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser