Permalink
Browse files

Really support extension-less files (and still support -o)

  • Loading branch information...
1 parent 889fcb2 commit 6aa7bd6a33466f0e9ec031dd65e69347df8d76d3 @evaryont evaryont committed with rtomayko Apr 3, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 bin/rocco
View
@@ -88,7 +88,7 @@ end
# Run each file through Rocco and write output.
sources.each do |filename|
rocco = Rocco.new(filename, sources, options)
- dest = File.join(output_dir, filename.split('.')[0..-2].join('.') + '.html')
+ dest = File.join(output_dir, (filename.split('.')[0..-2].empty? ? filename : filename.split('.')[0..-2].join('.')) + '.html')
puts "rocco: #{filename} -> #{dest}"
FileUtils.mkdir_p File.dirname(dest)
File.open(dest, 'wb') { |fd| fd.write(rocco.to_html) }

0 comments on commit 6aa7bd6

Please sign in to comment.