require 'rubygems' require 'syntax/convertors/html' def to_html(dirname) convertor = Syntax::Convertors::HTML.for_syntax "ruby" Dir.chdir(dirname) Dir.glob("*.rb") do |filename| f = File.new(filename.gsub(".rb", ".html"), "w") f << convertor.convert( File.read( filename ) ) f.close end end to_html(ARGV[0])