Method: Inspec::DependencySet.flatten_dep_tree
- Defined in:
- lib/inspec/dependencies/dependency_set.rb
.flatten_dep_tree(dep_tree) ⇒ Object
This is experimental code to test the working of the dependency loader - perform a proper dependency related search in the future.
Flatten tree because that is all we know how to deal with for right now. Last dep seen for a given name wins right now.
40 41 42 43 44 45 46 47 |
# File 'lib/inspec/dependencies/dependency_set.rb', line 40 def self.flatten_dep_tree(dep_tree) dep_list = {} dep_tree.each do |d| dep_list[d.name] = d dep_list.merge!(flatten_dep_tree(d.dependencies)) end dep_list end |