Sha256: 1c476a849e8d5a4efd4b0469ed5712f59b74fdae6fcd8b48023450fa9f673c55

Contents?: true

Size: 462 Bytes

Versions: 10

Compression:

Stored size: 462 Bytes

Contents

require 'tsort'

module Xcake
  class DependencyProvider
    include TSort

    def initialize(dependency_class)
      plugins = dependency_class.load_plugins

      @dependency_graph = plugins.each_with_object({}) do |p, hash|
        hash[p] = p.dependencies
      end
    end

    def tsort_each_node(&block)
      @dependency_graph.each_key(&block)
    end

    def tsort_each_child(node, &block)
      @dependency_graph[node].each(&block)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
xcake-0.13.0 lib/xcake/dependency_provider.rb
xcake-0.12.1 lib/xcake/dependency_provider.rb
xcake-0.12.0 lib/xcake/dependency_provider.rb
xcake-0.11.0 lib/xcake/dependency_provider.rb
xcake-0.10.0 lib/xcake/dependency_provider.rb
xcake-0.9.4 lib/xcake/dependency_provider.rb
xcake-0.9.3 lib/xcake/dependency_provider.rb
xcake-0.9.2 lib/xcake/dependency_provider.rb
xcake-0.9.1 lib/xcake/dependency_provider.rb
xcake-0.9.0 lib/xcake/dependency_provider.rb