chef 0.9.2 → 0.9.4

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.
data/lib/chef/resource.rb CHANGED
@@ -24,14 +24,17 @@ require 'chef/mixin/convert_to_class_name'
24
24
  require 'chef/resource_collection'
25
25
  require 'chef/node'
26
26
 
27
+ require 'chef/mixin/deprecation'
28
+
27
29
  class Chef
28
30
  class Resource
29
31
  HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name]
30
-
32
+
31
33
  include Chef::Mixin::CheckHelper
32
34
  include Chef::Mixin::ParamsValidate
33
35
  include Chef::Mixin::Language
34
36
  include Chef::Mixin::ConvertToClassName
37
+ include Chef::Mixin::Deprecation
35
38
 
36
39
  attr_accessor :params, :provider, :updated, :allowed_actions, :run_context, :cookbook_name, :recipe_name, :enclosing_provider
37
40
  attr_accessor :source_line
@@ -60,6 +63,8 @@ class Chef
60
63
  @notifies_immediate = Array.new
61
64
  @notifies_delayed = Array.new
62
65
  @source_line = nil
66
+
67
+ @node = run_context ? deprecated_ivar(run_context.node, :node, :warn) : nil
63
68
  end
64
69
 
65
70
  def node
@@ -237,9 +242,10 @@ class Chef
237
242
  def to_hash
238
243
  instance_vars = Hash.new
239
244
  self.instance_variables.each do |iv|
240
- iv = iv.to_s
241
- next if iv == "@run_context"
242
- instance_vars[iv.sub(/^@/,'').to_sym] = self.instance_variable_get(iv)
245
+ #iv = iv.to_s
246
+ #next if iv == "@run_context"
247
+ key = iv.to_s.sub(/^@/,'').to_sym
248
+ instance_vars[key] = self.instance_variable_get(iv) unless (key == :run_context) || (key == :node)
243
249
  end
244
250
  instance_vars
245
251
  end
data/lib/chef/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  class Chef
19
- VERSION = '0.9.2'
19
+ VERSION = '0.9.4'
20
20
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 2
9
- version: 0.9.2
8
+ - 4
9
+ version: 0.9.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Jacob