Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (20 sloc) 0.679 kB
require 'rubygems'
require 'middleman-gh-pages'
require 'fileutils'
#############################################################################
#
# GraphViz
#
#############################################################################
namespace :dot do
task :generate do
# Find each DOT file in dot/ directory.
Dir.glob('source/dot/**/*.dot').each do |path|
# Run graphviz over each one and move to the images/ directory.
destination = path.sub(/^source\/dot/, 'source/images')
destination.sub!(/\.dot$/, '.png')
FileUtils.mkdir_p(File.dirname(destination))
sh "dot #{path} -Tpng -o #{destination}"
end
end
end
Jump to Line
Something went wrong with that request. Please try again.