Class: RuboCop::Cop::Chef::Deprecations::ChefWindowsPlatformHelper
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb
Overview
Use ‘platform?(’windows’)‘ instead of the legacy `Chef::Platform.windows?` helper
Constant Summary collapse
- MSG =
"Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper."
- RESTRICT_ON_SEND =
[:windows?].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb', line 44 def on_send(node) chef_platform_windows?(node) do add_offense(node, severity: :warning) do |corrector| corrector.replace(node, "platform?('windows')") end end end |