Class: RuboCop::Cop::Chef::Modernize::RespondToProvides
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/modernize/respond_to_provides.rb
Overview
In Chef Infra Client 12+ is is no longer necessary to gate the use of the provides methods in resources with ‘if respond_to?(:provides)` or `if defined? provides`.
Constant Summary collapse
- MSG =
'Using `respond_to?(:provides)` or `if defined? provides` in resources is no longer necessary in Chef Infra Client 12+.'
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_if(node) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/rubocop/cop/chef/modernize/respond_to_provides.rb', line 39 def on_if(node) if_respond_to_provides?(node) do add_offense(node, severity: :refactor) do |corrector| corrector.replace(node, node.children[1].source) end end end |