10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/inspec/targets/archive.rb', line 10
def resolve(target, _opts = {})
files, rootdir = structure(target)
files = files.collect { |f| f.chomp('/') }
files = files.collect { |f|
Pathname(f).relative_path_from(Pathname(rootdir)).to_s
}
helper = DirsHelper.get_handler(files)
if helper.nil?
fail "Don't know how to handle folder #{target}"
end
res = {
test: collect(helper, files, :get_filenames),
library: collect(helper, files, :get_libraries),
metadata: collect(helper, files, :get_metadata),
}.map { |as, list|
content(target, list, rootdir, base_folder: target, as: as)
}
res.flatten
end
|