mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import RDoc 2.2.2 r192
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
da6300e8f8
commit
7222e82a8b
22 changed files with 115 additions and 54 deletions
|
@ -68,7 +68,12 @@ class RDoc::Parser
|
|||
|
||||
def self.binary?(file)
|
||||
s = (File.read(file, File.stat(file).blksize) || "").split(//)
|
||||
((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
|
||||
|
||||
if s.size > 0 then
|
||||
((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
private_class_method :binary?
|
||||
|
||||
|
@ -106,6 +111,13 @@ class RDoc::Parser
|
|||
|
||||
parser = can_parse file_name
|
||||
|
||||
#
|
||||
# This method must return a parser.
|
||||
#
|
||||
if !parser then
|
||||
parser = RDoc::Parser::Simple
|
||||
end
|
||||
|
||||
parser.new top_level, file_name, body, options, stats
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue