summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-19 05:08:28 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-19 05:08:28 +0000
commit75ef9e79d6f872d9155cfa69d717b0c693be7fc9 (patch)
tree97fa40e34793b267292d9d769150292a43f3838e /lib/rdoc/parser.rb
parent37e59f5583c781e98f41608251e094377237a133 (diff)
Import RDoc 2.5.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser.rb')
-rw-r--r--lib/rdoc/parser.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb
index 01e24e5d4b..9cfda127d9 100644
--- a/lib/rdoc/parser.rb
+++ b/lib/rdoc/parser.rb
@@ -75,8 +75,10 @@ class RDoc::Parser
false
elsif s.scan(/<%|%>/).length >= 4 || s.index("\x00") then
true
- else
+ elsif 0.respond_to? :fdiv then
s.count("^ -~\t\r\n").fdiv(s.size) > 0.3
+ else # HACK 1.8.6
+ (s.count("^ -~\t\r\n").to_f / s.size) > 0.3
end
end