Class: ComplianceEngine::EnvironmentLoader::Zip

Inherits:
ComplianceEngine::EnvironmentLoader show all
Defined in:
lib/compliance_engine/environment_loader/zip.rb

Overview

Load compliance engine data from a zip file containing a Puppet environment

Instance Attribute Summary

Attributes inherited from ComplianceEngine::EnvironmentLoader

#modulepath, #modules

Instance Method Summary collapse

Constructor Details

#initialize(path, root: '/'.dup) ⇒ Zip

Initialize a ComplianceEngine::EnvironmentLoader::Zip object from a zip file and an optional root directory.

Parameters:

  • path (String)

    the path to the zip file containing the Puppet environment

  • root (String) (defaults to: '/'.dup)

    a directory within the zip file to use as the root of the environment



14
15
16
17
18
19
20
21
22
23
# File 'lib/compliance_engine/environment_loader/zip.rb', line 14

def initialize(path, root: '/'.dup)
  @modulepath = path

  ::Zip::File.open(path) do |zipfile|
    dir = zipfile.dir
    file = zipfile.file

    super(root, fileclass: file, dirclass: dir)
  end
end