lib/graphviz/xml.rb in ruby-graphviz-0.8.0 vs lib/graphviz/xml.rb in ruby-graphviz-0.8.1

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (C) 2004, 2005, 2006, 2007 Gregoire Lejeune <gregoire.lejeune@free.fr> +# Copyright (C) 2004, 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. @@ -24,16 +24,32 @@ @oGraph @xNodeName @bShowText @bShowAttrs + # + # Generate the graph + # + # Options : + # :output : Output format (Constants::FORMATS) + # :file : Output file name + # :use : Program to use (Constants::PROGRAMS) + # :path : Program PATH + # def output( *hOpt ) @oGraph.output( *hOpt ) end private + # + # Create a graph from a XML file + # + # In: + # xFile : XML File + # *hOpt : Graph options + # def initialize( xFile, *hOpt ) @xNodeName = "00000" @bShowText = true @bShowAttrs = true @@ -53,10 +69,10 @@ @oReXML = REXML::Document::new( File::new( xFile ) ) @oGraph = GraphViz::new( "XML", *hOpt ) _init( @oReXML.root() ) end - def _init( oXMLNode ) + def _init( oXMLNode ) #:nodoc: xLocalNodeName = @xNodeName.clone @xNodeName.succ! label = oXMLNode.name if oXMLNode.has_attributes? == true and @bShowAttrs == true