Class: RuboCop::Cop::Chef::Deprecations::NodeDeepFetch
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb
Overview
The node.deep_fetch method has been removed from Chef-Sugar, and must be replaced by the node.read API.
Constant Summary collapse
- RESTRICT_ON_SEND =
[:deep_fetch, :deep_fetch!].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb', line 46 def on_send(node) node_deep_fetch?(node) do add_offense(node.loc.selector, message: "Do not use node.#{node.method_name}. Replace with node.#{fix_name(node.method_name)} to keep identical behavior.", severity: :warning) do |corrector| corrector.replace(node.loc.selector, fix_name(node.method_name)) end end end |