lib/ruote/tree_dot.rb in ruote-2.1.11 vs lib/ruote/tree_dot.rb in ruote-2.2.0

- old
+ new

@@ -1,7 +1,7 @@ #-- -# Copyright (c) 2005-2010, John Mettraux, jmettraux@gmail.com +# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -27,28 +27,28 @@ # Turns a process definition tree to a graphviz dot representation. # # http://www.graphviz.org # - def self.tree_to_dot (tree, name='ruote process definition') + def self.tree_to_dot(tree, name='ruote process definition') s = "digraph \"#{name}\" {\n" s << branch_to_dot('0', tree).join("\n") s << "\n}\n" end protected - def self.branch_to_dot (expid, exp) + def self.branch_to_dot(expid, exp) [ " \"#{expid}\" "+ "[ label = \"#{exp[0]} #{exp[1].inspect.gsub("\"", "'")}\" ];" ] + children_to_dot(expid, exp) end - def self.children_to_dot (expid, exp) + def self.children_to_dot(expid, exp) exp_name = exp[0] child_count = exp[2].size i = -1