Introducing the flowchartviz gem

require 'flowchartviz' 

s = "
if a then
  go left
  keep walking
else
  go right
  if raining?
    take an umbrella
end
"

fm = Flowchartviz.new(s)
fm.write '/tmp/flowchart.svg'

Output

G a a go left go left a->go left yes go right go right a->go right no keep walking keep walking go left->keep walking raining? raining? go right->raining? take an umbrella take an umbrella raining?->take an umbrella yes

Resources