bin/rocco works for extensionless files now (again?) too. README -> README.html.

This commit is contained in:
Burke Libbey 2010-03-30 15:01:01 -05:00
parent 8c948bbb95
commit 6595d5f885

View File

@ -90,7 +90,7 @@ Dir.mkdir output_dir if !File.directory?(output_dir)
# Run each file through Rocco and write output.
sources.each do |filename|
rocco = Rocco.new(filename, sources, options)
dest = "#{output_dir}/#{filename.scan(/(.*\/)?(.*)\.[^\.]+/)[0][1]}.html"
dest = "#{output_dir}/#{filename.scan(/(.*\/)?(.*?)(\.[^\.]+)?$/)[0][1]}.html"
puts "rocco: #{filename} -> #{dest}"
File.open(dest, 'wb') { |fd| fd.write(rocco.to_html) }
end