Class: Xcake::DependencyProvider
- Inherits:
-
Object
- Object
- Xcake::DependencyProvider
- Includes:
- TSort
- Defined in:
- lib/xcake/dependency_provider.rb
Instance Method Summary collapse
-
#initialize(dependency_class) ⇒ DependencyProvider
constructor
A new instance of DependencyProvider.
- #tsort_each_child(node, &block) ⇒ Object
- #tsort_each_node(&block) ⇒ Object
Constructor Details
#initialize(dependency_class) ⇒ DependencyProvider
Returns a new instance of DependencyProvider.
7 8 9 10 11 12 13 |
# File 'lib/xcake/dependency_provider.rb', line 7 def initialize(dependency_class) plugins = dependency_class.load_plugins @dependency_graph = plugins.each_with_object({}) do |p, hash| hash[p] = p.dependencies end end |
Instance Method Details
#tsort_each_child(node, &block) ⇒ Object
19 20 21 |
# File 'lib/xcake/dependency_provider.rb', line 19 def tsort_each_child(node, &block) @dependency_graph[node].each(&block) end |
#tsort_each_node(&block) ⇒ Object
15 16 17 |
# File 'lib/xcake/dependency_provider.rb', line 15 def tsort_each_node(&block) @dependency_graph.each_key(&block) end |