method
convert_to_png
v1_9_1_378 -
Show latest stable
- Class:
RDoc::Diagram
convert_to_png(file_base, graph)private
No documentation available.
# File lib/rdoc/diagram.rb, line 281
def convert_to_png(file_base, graph)
str = graph.to_s
return @diagram_cache[str] if @diagram_cache[str]
op_type = @options.image_format
dotfile = File.join(DOT_PATH, file_base)
src = dotfile + ".dot"
dot = dotfile + "." + op_type
unless @options.quiet
$stderr.print "."
$stderr.flush
end
File.open(src, 'w+' ) do |f|
f << str << "\n"
end
system "dot", "-T#{op_type}", src, "-o", dot
# Now construct the imagemap wrapper around
# that png
ret = wrap_in_image_map(src, dot)
@diagram_cache[str] = ret
return ret
end