* 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:
parent
0e62186da2
commit
2f2d213f7e
@ -203,11 +203,8 @@ module RDoc
|
|||||||
file_list.each do |filename|
|
file_list.each do |filename|
|
||||||
@stats.add_file filename
|
@stats.add_file filename
|
||||||
|
|
||||||
content = if RUBY_VERSION >= '1.9' then
|
content = File.open(filename, "rb") { |f| f.read }
|
||||||
File.open(filename, "r:ascii-8bit") { |f| f.read }
|
content.gsub!(/\r$/, '')
|
||||||
else
|
|
||||||
File.read filename
|
|
||||||
end
|
|
||||||
|
|
||||||
if defined?(::Encoding) then
|
if defined?(::Encoding) then
|
||||||
if /coding[=:]\s*([^\s;]+)/ =~ content[/\A(?:!.*\n)?(.*\n)/, 1]
|
if /coding[=:]\s*([^\s;]+)/ =~ content[/\A(?:!.*\n)?(.*\n)/, 1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user