Class: RuboCop::Cop::Chef::ChefDeprecations::UsesRunCommandHelper
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Chef::ChefDeprecations::UsesRunCommandHelper
- Defined in:
- lib/rubocop/cop/chef/deprecation/run_command_helper.rb
Overview
Use ‘shell_out!’ instead of the legacy ‘run_command’ or ‘run_command_with_systems_locale’ helpers for shelling out. The run_command helper was removed in Chef Infra Client 13.
Constant Summary collapse
- MSG =
"Use 'shell_out!' instead of the legacy 'run_command' or 'run_command_with_systems_locale' helpers for shelling out. The run_command helper was removed in Chef Infra Client 13.".freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
38 39 40 41 42 |
# File 'lib/rubocop/cop/chef/deprecation/run_command_helper.rb', line 38 def on_send(node) calls_run_command?(node) do add_offense(node, location: :expression, message: MSG, severity: :refactor) unless defines_run_command?(processed_source.ast) end end |