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
36
37
|
# 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
raw_files = helper.get_filenames(files)
tests = content(target, raw_files, rootdir, base_folder: target)
libs = []
if helper.respond_to? :get_libraries
raw_libs = helper.get_libraries(files)
libs = content(target, raw_libs, rootdir, base_folder: target, as: :library)
end
libs + tests
end
|