Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.2
Fetching contributors…

Cannot retrieve contributors at this time

executable file 36 lines (33 sloc) 0.801 kb
#!/usr/bin/env ruby
libdir = File.expand_path('../../lib', __FILE__).sub(/^#{Dir.pwd}\//, '')
begin
require 'rdiscount'
require 'rocco'
rescue LoadError
case $!.to_s
when /rdiscount/
if !defined?(Gem)
warn "warn: #$!. trying again with rubygems"
require 'rubygems'
retry
else
require 'bluecloth'
Markdown = BlueCloth
$LOADED_FEATURES << 'rdiscount.rb'
retry
end
when /rocco/
if !$:.include?(libdir)
warn "warn: #$!. trying again with #{libdir} on load path"
$:.unshift(libdir)
retry
end
end
raise
end
ARGV.each do |filename|
rocco = Rocco.new(filename)
dest = File.basename(filename, '.rb') + '.html'
warn "rocco: #{filename} -> #{dest}"
File.open(dest, 'wb') { |fd| fd.write(rocco.to_html) }
end
Jump to Line
Something went wrong with that request. Please try again.