Class: RuboCop::Cop::Chef::ChefDeprecations::ResourceUsesProviderBaseMethod

Inherits:
RuboCop::Cop
  • Object
show all
Defined in:
lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb

Overview

The Resource.provider_base allows the developer to specify within a resource a module to load the resource’s provider from. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use.

Examples:


# bad
provider_base ::Chef::Provider::SomethingSomething

Constant Summary collapse

MSG =
"Don't use the deprecated provider_base method in a resource to specify the provider module to use. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use. This will cause failures in Chef Infra Client 13 and later.".freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



31
32
33
# File 'lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb', line 31

def on_send(node)
  add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :provider_base
end