class RuboCop::Cop::Chef::Deprecations::LaunchdDeprecatedHashProperty

The launchd resource’s hash property was renamed to plist_hash in Chef Infra Client 13+ to avoid conflicts with Ruby’s hash class.

@example

#### incorrect
launchd 'foo' do
  hash foo: 'bar'
end

#### correct
launchd 'foo' do
  plist_hash foo: 'bar'
end

Constants

MSG

Public Instance Methods

on_block(node) click to toggle source
# File lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb, line 45
def on_block(node)
  match_property_in_resource?(:launchd, 'hash', node) do |offense|
    add_offense(offense.loc.expression, severity: :warning) do |corrector|
      corrector.replace(offense.loc.expression, offense.loc.expression.source.gsub(/^hash/, 'plist_hash'))
    end
  end
end