Sha256: ac50c4b9980f6b2908217610552552598e113533ac6709c3f98ee8225957802f

Contents?: true

Size: 439 Bytes

Versions: 17

Compression:

Stored size: 439 Bytes

Contents

require 'tsort'

module Xcake
  class DependencyProvider
    include TSort

    def initialize(dependency_class)
      plugins = dependency_class.load_plugins

      @dependency_graph = plugins.map do |p|
        [p, p.dependencies]
      end.to_h
    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

17 entries across 17 versions & 1 rubygems

Version Path
xcake-0.8.13 lib/xcake/dependency_provider.rb
xcake-0.8.12 lib/xcake/dependency_provider.rb
xcake-0.8.10 lib/xcake/dependency_provider.rb
xcake-0.8.9 lib/xcake/dependency_provider.rb
xcake-0.8.8 lib/xcake/dependency_provider.rb
xcake-0.8.7 lib/xcake/dependency_provider.rb
xcake-0.8.6 lib/xcake/dependency_provider.rb
xcake-0.8.3 lib/xcake/dependency_provider.rb
xcake-0.8.1 lib/xcake/dependency_provider.rb
xcake-0.7.1 lib/xcake/dependency_provider.rb
xcake-0.7.0 lib/xcake/dependency_provider.rb
xcake-0.6.25 lib/xcake/dependency_provider.rb
xcake-0.6.24 lib/xcake/dependency_provider.rb
xcake-0.6.23 lib/xcake/dependency_provider.rb
xcake-0.6.22 lib/xcake/dependency_provider.rb
xcake-0.6.21 lib/xcake/dependency_provider.rb
xcake-0.6.20 lib/xcake/dependency_provider.rb