Class: RuboCop::Cop::Chef::Deprecations::ResourceOverridesProvidesMethod
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Chef::Deprecations::ResourceOverridesProvidesMethod
- Defined in:
- lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb
Overview
Some providers in resources override the provides? method, used to check whether they are a valid provider on the current platform. In Chef Infra Client 13, this will cause an error. Instead use ‘provides :SOME_PROVIDER_NAME` to register the provider.
Constant Summary collapse
- MSG =
"Don't override the provides? method in a resource provider. Use provides :SOME_PROVIDER_NAME instead. This will cause failures in Chef Infra Client 13 and later."
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_def(node) ⇒ Object
39 40 41 42 43 |
# File 'lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb', line 39 def on_def(node) return unless node.method?(:provides?) add_offense(node, severity: :warning) unless calls_provides?(processed_source.ast) end |