Class: RuboCop::Cop::Chef::Deprecations::PowershellCookbookHelpers
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb
Overview
Use ‘node[’version’]‘ or the new `powershell_version` helper available in Chef Infra Client 15.8+ instead of the deprecated PowerShell cookbook helpers
Constant Summary collapse
- MSG =
"Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 15.8+ instead of the deprecated PowerShell cookbook helpers."
- RESTRICT_ON_SEND =
[:powershell_version?].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb', line 48 def on_send(node) ps_cb_helper?(node) do |ver| add_offense(node, severity: :warning) do |corrector| corrector.replace(node, "node['powershell']['version'].to_f == #{ver.source}") end end end |