From b51158fd455e90207a0fd3aaee872387be72cc02 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: http://svn.ruby-lang.org/repos/ruby/trunk@24990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/rdoc.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') 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] -- cgit