summaryrefslogtreecommitdiff
path: root/bin/coderay
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2014-01-23 22:23:59 +0100
committerKornelius Kalnbach <murphy@rubychan.de>2014-01-23 22:23:59 +0100
commitee76cc5df42af385743d81ec0810073b7c9ed465 (patch)
tree89387c694298768c2ea4766eff097cdd5006fbdf /bin/coderay
parent4131a5ff622e7c767dfd042c4c357906a2544c01 (diff)
parente93aae88985667189bb5b24ad0d5f54cb5fdba70 (diff)
downloadcoderay-ee76cc5df42af385743d81ec0810073b7c9ed465.tar.gz
Merge branch 'master' into bash-scanner
Conflicts: lib/coderay/helpers/file_type.rb
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