glejeune / Ruby-Graphviz

[MIRROR] Ruby interface to the GraphViz graphing tool
https://gitlab.com/glejeune/ruby-graphviz
Other
608 stars 116 forks source link

":output option is deprecated, please use :<format> => :<file>" #22

Closed ghost closed 13 years ago

ghost commented 13 years ago

asm = GraphViz::new("My ASM", hOpts = {:output => "png"})

I tried all sorts of combinations to avoid this warning, but none of them worked.

Could you give an example of the "correct" way of doing this?

glejeune commented 13 years ago

Hi,

Here is the solution :

asm = GraphViz::new("My ASM")
# ...
asm.output( :png => "myAsm.png" )

You can see a lot of examples of usage in the examples' directory : https://github.com/glejeune/Ruby-Graphviz/tree/master/examples

ghost commented 13 years ago

I did try something like that

require "graphviz"

asm = GraphViz::new("My ASM") asm.output(:png => "myAsm.png")

/home/lewis/.rvm/gems/ruby-1.9.2-p180/gems/ruby-graphviz-0.9.21/lib/graphviz/utils.rb:74:in output_from_command': Error from "/usr/bin/dot" -q1 -Tpng -omyAsm.png /tmp/graphviz.rb20110421-5540-14jks7: (RuntimeError) Error: /tmp/graphviz.rb20110421-5540-14jks7:1: syntax error near line 1 context: digraph My >>> ASM <<< { from /home/lewis/.rvm/gems/ruby-1.9.2-p180/gems/ruby-graphviz-0.9.21/lib/graphviz.rb:606:in output' from asm.rb:4:in `

'

shell returned 1

Is that a problem with the gem or my version of graphviz?

On 21/04/2011, glejeune reply@reply.github.com wrote:

Hi,

Here is the solution :

asm = GraphViz::new("My ASM")
# ...
asm.output( :png => "myAsm.png" )

You can see a lot of examples of usage in the examples' directory : https://github.com/glejeune/Ruby-Graphviz/tree/master/examples

Reply to this email directly or view it on GitHub: https://github.com/glejeune/Ruby-Graphviz/issues/22#comment_1038033

glejeune commented 13 years ago

Ho!

Ok, this is because the graph ID have an space! This is a bug !

I'll correct it, in the meantime try with

asm = GraphViz::new("MyASM")

Greg

glejeune commented 13 years ago

OK, I just push a correction. See sample 60 and 61 !

This correction will be in the 1.0 version.

Greg

ghost commented 13 years ago

Ah, works now.

Glad I could help you catch a bug:)

On 21/04/2011, glejeune reply@reply.github.com wrote:

Ho!

Ok, this is because the graph ID have an space! This is a bug !

I'll correct it, in the meantime try with

asm = GraphViz::new("MyASM")

Greg

Reply to this email directly or view it on GitHub: https://github.com/glejeune/Ruby-Graphviz/issues/22#comment_1038364

glejeune commented 13 years ago

Yea! Thank you!