Check that the right version of ‘dot’ is available. Unfortuately this
doesn’t work correctly under Windows NT, so we’ll bypass the test
under Windows
# File lib/rdoc/options.rb, line 548
def check_diagram
return if RUBY_PLATFORM =~ /mswin|cygwin|mingw|bccwin/
ok = false
ver = nil
IO.popen("dot -V 2>&1") do |io|
ver = io.read
if ver =~ /dot.+version(?:\s+gviz)?\s+(\d+)\.(\d+)/
ok = ($1.to_i > 1) || ($1.to_i == 1 && $2.to_i >= 8)
end
end
unless ok
if ver =~ /^dot.+version/
$stderr.puts "Warning: You may need dot V1.8.6 or later to use\n",
"the --diagram option correctly. You have:\n\n ",
ver,
"\nDiagrams might have strange background colors.\n\n"
else
$stderr.puts "You need the 'dot' program to produce diagrams.",
"(see http://www.research.att.com/sw/tools/graphviz/)\n\n"
exit
end
# exit
end
end