Method: Inspec::Resources::CpanPackage#initialize

Defined in:
lib/resources/cpan.rb

#initialize(package_name, perl_lib_path = nil) ⇒ CpanPackage

Returns a new instance of CpanPackage.



20
21
22
23
24
25
26
27
28
# File 'lib/resources/cpan.rb', line 20

def initialize(package_name, perl_lib_path = nil)
  @package_name = package_name
  @perl_lib_path = perl_lib_path
  @perl_cmd = 'perl'

  # this resource is not supported on Windows
  return skip_resource 'The `cpan` resource is not supported on your OS yet.' if inspec.os.windows?
  return skip_resource 'perl not found' unless inspec.command(@perl_cmd).exist?
end