summaryrefslogtreecommitdiffstats
path: root/lib/rdoc/rdoc.rb
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
commitb51158fd455e90207a0fd3aaee872387be72cc02 (patch)
treee88c5d1158c37b6c7885f88ad00de09f365d2036 /lib/rdoc/rdoc.rb
parent781ee209ac37b8c593191c06800386fe61acd8c3 (diff)
downloadruby-b51158fd455e90207a0fd3aaee872387be72cc02.tar.gz
ruby-b51158fd455e90207a0fd3aaee872387be72cc02.tar.xz
ruby-b51158fd455e90207a0fd3aaee872387be72cc02.zip
* lib/rdoc/rdoc.rb (RDoc::RDoc#parse_files): don't branch by
RUBY_VERSION. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/rdoc.rb')
-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 9ddece89e..80128ee8b 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]