glejeune / Ruby-Graphviz

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

do not fail if @filename has spaces. #82

Closed shaiguitar closed 10 years ago

shaiguitar commented 10 years ago

No test in the PR but it should fix AFAICT. I used the backtrace to fix it. I got this error:

/Users/shair/.rvm/gems/ruby-1.9.3-p392/gems/ruby-graphviz-1.0.9/lib/graphviz/utils.rb:77:in `output_from_command': Error from "/usr/local/bin/dot" -q1   -Tpng -ocourse_dep_with a space.png   /var/folders/x0/kp053jk11bg93w_rr2j8m9zh0000gq/T/graphviz.rb20131114-24816-b2aetd: (RuntimeError)
Error: dot: can't open a space.png
    from /Users/shair/.rvm/gems/ruby-1.9.3-p392/gems/ruby-graphviz-1.0.9/lib/graphviz.rb:589:in `output'
    from graph_lessons.rb:30:in `
'

When trying to save like this:

g.output(:png => "course_dep_#{name_with_spaces}.png")

Either way, thanks for this great gem!

glejeune commented 10 years ago

We need a better solution, this one does not work on OSX