34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/inspec/dependencies/resolver.rb', line 34
def detect_duplicates(deps, top_level, path_string)
seen_items_local = []
deps.each do |dep|
if seen_items_local.include?(dep.name)
problem_cookbook = if top_level
'the inspec.yml for this profile.'
else
"the dependency information for #{path_string.split(' ').last}"
end
fail Inspec::DuplicateDep, "The dependency #{dep.name} is listed twice in #{problem_cookbook}"
else
seen_items_local << dep.name
end
end
end
|