summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-18 00:03:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-18 00:03:18 +0000
commit2f2d213f7ee95493386442a538bd1190c1aad410 (patch)
treee88c5d1158c37b6c7885f88ad00de09f365d2036
parent0e62186da2f49a6ef1351a7c5aa61e941589c1bf (diff)
* lib/rdoc/rdoc.rb (RDoc::RDoc#parse_files): don't branch by
RUBY_VERSION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rdoc/rdoc.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index 9ddece89e0b..80128ee8ba5 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -203,11 +203,8 @@ module RDoc
file_list.each do |filename|
@stats.add_file filename
- content = if RUBY_VERSION >= '1.9' then
- File.open(filename, "r:ascii-8bit") { |f| f.read }
- else
- File.read filename
- end
+ content = File.open(filename, "rb") { |f| f.read }
+ content.gsub!(/\r$/, '')
if defined?(::Encoding) then
if /coding[=:]\s*([^\s;]+)/ =~ content[/\A(?:!.*\n)?(.*\n)/, 1]