class RuboCop::Cop::Chef::Deprecations::UseAutomaticResourceName

The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.

@example

#### incorrect
module MyCookbook
  class MyCookbookService < Chef::Resource
    use_automatic_resource_name
    provides :mycookbook_service

    # some additional code
  end
end

Constants

MSG
RESTRICT_ON_SEND

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/chef/deprecation/use_automatic_resource_name.rb, line 43
def on_send(node)
  add_offense(node.loc.selector, severity: :warning) do |corrector|
    corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
  end
end