1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2009-09-18 00:03:18 +00:00
parent 0e62186da2
commit 2f2d213f7e

View file

@ -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]