compat_resource 12.5.12 → 12.5.13

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: 0d9d7d3c88772f90ebde8c0634f2a8ac96d046a7
4
- data.tar.gz: dc631ea82b7f9ff861d9e40572ca9a7e5a0a8f00
3
+ metadata.gz: 0364cf51b6e8bd0647b1e063491ea460d696c51e
4
+ data.tar.gz: cae74d55c45d82299431f30501fbb19a1332d92e
5
5
  SHA512:
6
- metadata.gz: 4dc5c54a98a548aa219facb6b68f97b5b44dc28da7d7c2007a5177dbc4976f2c5dc1eb174f506dfe17ef38f88f1c0b7d1ea8915b400613115761e7ca797f1340
7
- data.tar.gz: a87f06f630a1c07e3d60c03fb4cd2fb60e90cd931c82e434b06355d9901c980330e985803c8a9862ea212e9f1ce78f5a648c41dcf90553a7178dadf6151cea8a
6
+ metadata.gz: 5224dd3026a3d06139819a0269d797adce4ede96e6c54c66d8713aee7e226b1cd8eb8623a5c796f8c45c157cd33d407e63e0819cb881dfee0ae275501fc4129b
7
+ data.tar.gz: 4a008fc0be6d5c07e4390471e9d96cbbdf31d4c32d18d5606decdd7d990e8b5acb34b49d72d16a42d34dc708e9e03c33beaf44c31da89a4f9486ee0d8fcd244b
@@ -3,7 +3,7 @@ class Chef
3
3
  # Earlier versions of Chef didn't have this message
4
4
  module ChefCompatDeprecation
5
5
  def log_deprecation(message, location=nil)
6
- if superclass.method(:log_deprecation).owner != ChefCompatDeprecation
6
+ if method(:log_deprecation).super_method
7
7
  if !location
8
8
  # Pick the first caller that is *not* part of the Chef or ChefCompat gem,
9
9
  # that's the thing the user wrote.
@@ -1,4 +1,4 @@
1
- require 'chef_compat/resource'
1
+ require 'chef_compat/resource/lwrp_base'
2
2
  require 'chef/resource/lwrp_base'
3
3
 
4
4
  module ChefCompat
@@ -29,7 +29,7 @@ module ChefCompat
29
29
  ChefCompat::Monkeypatches::Class.module_eval do
30
30
  remove_method(:new) if method_defined?(:new)
31
31
  end
32
- args = [ ChefCompat::Resource ]
32
+ args = [ ChefCompat::Resource::LWRPBase ]
33
33
  end
34
34
  super(*args, &block)
35
35
  end
@@ -45,15 +45,5 @@ module ChefCompat
45
45
  resource_name(name)
46
46
  end
47
47
  end
48
-
49
- # for LWRPBase
50
- def self.run_context
51
- @run_context
52
- end
53
- def self.run_context=(arg)
54
- @run_context = arg
55
- end
56
- require 'chef/mixin/from_file'
57
- extend Chef::Mixin::FromFile
58
48
  end
59
49
  end
@@ -0,0 +1,44 @@
1
+ require 'chef_compat/resource'
2
+ require 'chef_compat/copied_from_chef/chef/resource'
3
+ require 'chef/mixin/convert_to_class_name'
4
+ require 'chef/mixin/from_file'
5
+
6
+ module ChefCompat
7
+ class Resource < ChefCompat::CopiedFromChef::Chef::Resource
8
+ class LWRPBase < ChefCompat::Resource
9
+ class<<self
10
+
11
+ include Chef::Mixin::ConvertToClassName
12
+ include Chef::Mixin::FromFile
13
+
14
+ alias :attribute :property
15
+
16
+ # Adds +action_names+ to the list of valid actions for this resource.
17
+ # Does not include superclass's action list when appending.
18
+ def actions(*action_names)
19
+ action_names = action_names.flatten
20
+ if !action_names.empty? && !@allowed_actions
21
+ self.allowed_actions = ([ :nothing ] + action_names).uniq
22
+ else
23
+ allowed_actions(*action_names)
24
+ end
25
+ end
26
+ alias :actions= :allowed_actions=
27
+
28
+ # @deprecated
29
+ def valid_actions(*args)
30
+ Chef::Log.warn("`valid_actions' is deprecated, please use allowed_actions `instead'!")
31
+ allowed_actions(*args)
32
+ end
33
+
34
+ # Set the run context on the class. Used to provide access to the node
35
+ # during class definition.
36
+ attr_accessor :run_context
37
+
38
+ def node
39
+ run_context ? run_context.node : nil
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,3 +1,3 @@
1
1
  module ChefCompat
2
- VERSION = '12.5.12' if !defined?(VERSION)
2
+ VERSION = '12.5.13' if !defined?(VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compat_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.5.12
4
+ version: 12.5.13
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-10-29 00:00:00.000000000 Z
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -111,6 +111,7 @@ files:
111
111
  - files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb
112
112
  - files/lib/chef_compat/property.rb
113
113
  - files/lib/chef_compat/resource.rb
114
+ - files/lib/chef_compat/resource/lwrp_base.rb
114
115
  - files/lib/chef_compat/version.rb
115
116
  homepage: http://chef.io
116
117
  licenses: