diff options
author | Xabier de Zuazo <xabier@onddo.com> | 2014-12-02 20:23:14 +0100 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-01-27 12:03:50 -0800 |
commit | 74770bd862180d90e0d2c5381ad74dd7ec637242 (patch) | |
tree | 3f4ee7eadfa50d6e87754fd9863c85f4411bc420 /lib/chef/resource.rb | |
parent | bbecbb9b550d0ad9daaebbfc04fb6e3ce919731a (diff) | |
download | chef-74770bd862180d90e0d2c5381ad74dd7ec637242.tar.gz |
Resource: use #const_defined? with arity 2 (ruby < 2 specific, issues #2497, #2503)
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index 3dc0ae409b..776d1f5440 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -651,6 +651,7 @@ class Chef include Chef::Mixin::ParamsValidate include Chef::Mixin::Deprecation +<<<<<<< HEAD # # The provider class for this resource. # @@ -669,6 +670,13 @@ class Chef arg end set_or_return(:provider, klass, kind_of: [ Class ]) +======= + extend Chef::Mixin::ConvertToClassName + extend Chef::Mixin::DescendantsTracker + + def self.strict_const_defined?(const) + const_defined?(const, false) +>>>>>>> Resource: use #const_defined? with arity 2 (ruby < 2 specific, issues #2497, #2503) end def provider=(arg) provider(arg) @@ -931,14 +939,8 @@ class Chef run_context.notifies_delayed(Notification.new(resource_spec, action, self)) end - if Module.method(:const_defined?).arity == 1 - def self.strict_const_defined?(const) - const_defined?(const) - end - else - def self.strict_const_defined?(const) - const_defined?(const, false) - end + def self.strict_const_defined?(const) + const_defined?(const, false) end class << self |