[ruby/rdoc] Use File.binread

https://github.com/ruby/rdoc/commit/987c609df9
This commit is contained in:
Nobuyoshi Nakada 2022-03-29 00:52:10 +09:00 committed by git
parent 8523892d08
commit cd65e4adca

View File

@ -429,9 +429,7 @@ The internal error was:
files.reject do |file, *|
file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or
(file =~ /tags$/i and
File.open(file, 'rb') { |io|
io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/
})
/\A(\f\n[^,]+,\d+$|!_TAG_)/.match?(File.binread(file, 100)))
end
end