Method: Inspec::Resources::CranPackage#initialize

Defined in:
lib/inspec/resources/cran.rb

#initialize(package_name) ⇒ CranPackage

Returns a new instance of CranPackage.



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

def initialize(package_name)
  @package_name = package_name
  @r_cmd = "Rscript"

  # this resource is not supported on Windows
  return skip_resource "The `cran` resource is not supported on your OS yet." if inspec.os.windows?
  return skip_resource "Rscript not found" unless inspec.command(@r_cmd).exist?
end