brew/Library/Homebrew/cask/lib/hbc/topological_hash.rb
AnastasiaSulyagina e81f4ab7de init
2016-08-19 14:50:14 +03:00

13 lines
219 B
Ruby

require "tsort"
# a basic topologically sortable hashmap
class Hbc::TopologicalHash < Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end