Class: RuboCop::Cop::Chef::Deprecations::CookbookDependsOnPoise

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/chef/deprecation/depends_poise.rb

Overview

Cookbooks should not depend on the deprecated Poise framework cookbooks. They should instead be refactored to use standard Chef Infra custom resources.

Examples:


### incorrect
depends 'poise'
depends 'poise-service'
depends 'poise-hoist'

Constant Summary collapse

MSG =
'Cookbooks should not depend on the deprecated Poise framework'
RESTRICT_ON_SEND =
[:depends].freeze

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



39
40
41
42
43
# File 'lib/rubocop/cop/chef/deprecation/depends_poise.rb', line 39

def on_send(node)
  depends_method?(node) do |arg|
    add_offense(node, severity: :warning) if %w(poise poise-service poise-hoist).include?(arg.value)
  end
end