summaryrefslogtreecommitdiff
path: root/bin/coderay
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-23 13:29:01 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-23 13:29:01 +0200
commit1d445c70edf8d5c878f9a830dcd29f5a3e179923 (patch)
tree75ad0b7db37981acd3bf54984353e70229e351ad /bin/coderay
parentd9d6dd5f4a73363ea5d353ecda142f77ed4eba5a (diff)
parent1e330f16c21c45eff375ba3b12f966c76ba0b393 (diff)
downloadcoderay-1d445c70edf8d5c878f9a830dcd29f5a3e179923.tar.gz
Merge branch 'master' into upstream
Diffstat (limited to 'bin/coderay')
-rwxr-xr-xbin/coderay8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/coderay b/bin/coderay
index d78cd57..889ae72 100755
--- a/bin/coderay
+++ b/bin/coderay
@@ -125,7 +125,7 @@ when 'highlight', nil
end
if output_file
- output_format ||= CodeRay::FileType[output_file]
+ output_format ||= CodeRay::FileType[output_file] || :plain
else
output_format ||= :terminal
end
@@ -143,7 +143,6 @@ when 'highlight', nil
if output_file
File.open output_file, 'w'
else
- $stdout.sync = true
$stdout
end
CodeRay.encode(input, input_lang, output_format, :out => file)
@@ -156,8 +155,9 @@ when 'highlight', nil
puts boom.message
end
# puts "I don't know this plugin: #{boom.message[/Could not load plugin (.*?): /, 1]}."
- rescue CodeRay::Scanners::Scanner::ScanError # FIXME: rescue Errno::EPIPE
- # this is sometimes raised by pagers; ignore [TODO: wtf?]
+ rescue CodeRay::Scanners::Scanner::ScanError
+ # this is sometimes raised by pagers; ignore
+ # FIXME: rescue Errno::EPIPE
ensure
file.close if output_file
end