From 2f2d213f7ee95493386442a538bd1190c1aad410 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 18 Sep 2009 00:03:18 +0000 Subject: * 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 --- lib/rdoc/rdoc.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/rdoc/rdoc.rb') diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 9ddece89e0..80128ee8ba 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] -- cgit v1.2.3