Class: RuboCop::Cop::Chef::Modernize::WindowsZipfileUsage

Inherits:
Base
  • Object
show all
Extended by:
TargetChefVersion
Defined in:
lib/rubocop/cop/chef/modernize/windows_zipfile.rb

Overview

Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook

Examples:


# bad
windows_zipfile 'C:\files' do
  source 'C:\Temp\file.zip'
end

# good
archive_file 'expand file.zip' do
  path 'C:\Temp\file.zip'
  destination 'C:\files'
end

Constant Summary collapse

MSG =
'Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook'
RESTRICT_ON_SEND =
[:windows_zipfile].freeze

Instance Method Summary collapse

Methods included from TargetChefVersion

minimum_target_chef_version, required_minimum_chef_version, support_target_chef_version?

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



45
46
47
# File 'lib/rubocop/cop/chef/modernize/windows_zipfile.rb', line 45

def on_send(node)
  add_offense(node, severity: :refactor)
end