Method: Inspec::ZipProvider#initialize
- Defined in:
- lib/inspec/file_provider.rb
#initialize(path) ⇒ ZipProvider
Returns a new instance of ZipProvider.
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/inspec/file_provider.rb', line 96 def initialize(path) @path = path @contents = {} @files = [] walk_zip(@path) do |io| while (entry = io.get_next_entry) name = entry.name.sub(%r{/+$}, "") @files.push(name) unless name.empty? || name.squeeze("/") =~ %r{\.{2}(?:/|\z)} end end end |