Sha256: 2ca149d86e37e9a5d6792bb506f6c8c91e75f38ef9c11fe110487745c08d65c8

Contents?: true

Size: 373 Bytes

Versions: 30

Compression:

Stored size: 373 Bytes

Contents

require 'tsort'

module Pupa
  class Processor
    # A simple implementation of a dependency graph.
    #
    # @see http://ruby-doc.org/stdlib-2.0.0/libdoc/tsort/rdoc/TSort.html
    class DependencyGraph < Hash
      include TSort

      alias tsort_each_node each_key

      def tsort_each_child(node, &block)
        fetch(node).each(&block)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
pupa-0.2.4 lib/pupa/processor/dependency_graph.rb
pupa-0.2.3 lib/pupa/processor/dependency_graph.rb
pupa-0.2.2 lib/pupa/processor/dependency_graph.rb
pupa-0.2.1 lib/pupa/processor/dependency_graph.rb
pupa-0.2.0 lib/pupa/processor/dependency_graph.rb
pupa-0.1.11 lib/pupa/processor/dependency_graph.rb
pupa-0.1.10 lib/pupa/processor/dependency_graph.rb
pupa-0.1.9 lib/pupa/processor/dependency_graph.rb
pupa-0.1.8 lib/pupa/processor/dependency_graph.rb
pupa-0.1.7 lib/pupa/processor/dependency_graph.rb
pupa-0.1.6 lib/pupa/processor/dependency_graph.rb
pupa-0.1.5 lib/pupa/processor/dependency_graph.rb
pupa-0.1.4 lib/pupa/processor/dependency_graph.rb
pupa-0.1.3 lib/pupa/processor/dependency_graph.rb
pupa-0.1.2 lib/pupa/processor/dependency_graph.rb
pupa-0.1.1 lib/pupa/processor/dependency_graph.rb
pupa-0.1.0 lib/pupa/processor/dependency_graph.rb
pupa-0.0.13 lib/pupa/processor/dependency_graph.rb
pupa-0.0.12 lib/pupa/processor/dependency_graph.rb
pupa-0.0.11 lib/pupa/processor/dependency_graph.rb