Skip to content

Instantly share code, notes, and snippets.

@marioaquino
Created January 10, 2009 12:39
Show Gist options
  • Save marioaquino/45448 to your computer and use it in GitHub Desktop.
Save marioaquino/45448 to your computer and use it in GitHub Desktop.
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])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment