Skip to content

Instantly share code, notes, and snippets.

@ehelms
Created July 1, 2013 20:25
Show Gist options
  • Save ehelms/5904264 to your computer and use it in GitHub Desktop.
Save ehelms/5904264 to your computer and use it in GitHub Desktop.
def run(plan)
step = next_step(plan)
puts step
end
def next_step(plan)
case plan
when ExecutionPlan::Sequence
step = check_plan(plan)
when ExecutionPlan::Concurrence
step = check_plan(plan)
when RunStep
step = check_step(plan)
when true
return true
else
raise ArgumentError, "Don't know how to run #{plan}"
end
return step
end
def check_plan(plan)
plan.steps.each do |step|
current_step = next_step(step)
if current_step != true
return current_step
end
end
return true
end
def check_step(step)
if %w[skipped success].include?(step.status)
return true
else
return step
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment