Sha256: 70ed7d560d2b26771508629ce0d643b8b9287ec581045fc3559db94062561abc

Contents?: true

Size: 678 Bytes

Versions: 76

Compression:

Stored size: 678 Bytes

Contents

module Dynflow
  class ExecutionPlan::DependencyGraph

    def initialize
      @graph = Hash.new { |h, k| h[k] = Set.new }
    end

    # adds dependencies to graph that +step+ has based
    # on the steps referenced in its +input+
    def add_dependencies(step, action)
      action.required_step_ids.each do |required_step_id|
        @graph[step.id] << required_step_id
      end
    end

    def required_step_ids(step_id)
      @graph[step_id]
    end

    def mark_satisfied(step_id, required_step_id)
      @graph[step_id].delete(required_step_id)
    end

    def unresolved?
      @graph.any? { |step_id, required_step_ids| required_step_ids.any? }
    end

  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
dynflow-1.3.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.2.3 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.2.2 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.2.1 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.2.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.2.0.pre1 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.6 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.5 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.4 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.3 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.2 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.1 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.1.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.0.5 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.0.4 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.0.3 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.0.2 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.0.1 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.0.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-0.8.37 lib/dynflow/execution_plan/dependency_graph.rb