Sha256: 1a08dfa87947a9cd66c43a231cd4cfb3af137ee02bc11b4d372aedec28bddb17

Contents?: true

Size: 708 Bytes

Versions: 25

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true
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

25 entries across 25 versions & 1 rubygems

Version Path
dynflow-1.8.2 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.8.1 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.8.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.7.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.11 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.10 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.8 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.7 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.6 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.5 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.4 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.3 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.2 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.6.1 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.4.9 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.4.8 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.5.0 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.4.7 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.4.6 lib/dynflow/execution_plan/dependency_graph.rb
dynflow-1.4.5 lib/dynflow/execution_plan/dependency_graph.rb