Skip to content

Instantly share code, notes, and snippets.

@thagomizer
Created April 24, 2019 02:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save thagomizer/5bf613022e323a5134d22a4e4e8f026d to your computer and use it in GitHub Desktop.
require 'graph'
require 'psych'
steps = Psych.load(File.read(ARGV[0]))["steps"]
previous_steps = []
digraph do
steps.each do |step|
id = step["id"] || step["name"]
deps = step["waitFor"] || previous_steps
deps.each do |dep|
break if dep == "-"
edge dep, id
end
previous_steps << id
end
save "buildgraph", "png"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment