From 994876860b4f2a9bf4f22c436527e7220c82d5b4 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Nov 2010 12:49:11 +0000 Subject: [PATCH] * lib/rdoc/stats.rb (RDoc#print): get rid of NaN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/rdoc/stats.rb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e78e7dd621..247a2a82c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Nov 11 21:49:06 2010 Nobuyoshi Nakada + + * lib/rdoc/stats.rb (RDoc#print): get rid of NaN. + Thu Nov 11 21:47:12 2010 Nobuyoshi Nakada * common.mk (SHOWFLAGS): show compile flags. diff --git a/lib/rdoc/stats.rb b/lib/rdoc/stats.rb index 82e0afdf5d..6a5d96faa8 100644 --- a/lib/rdoc/stats.rb +++ b/lib/rdoc/stats.rb @@ -89,7 +89,7 @@ class RDoc::Stats doc_items = items - nodoc_classes - @nodoc_constants - nodoc_modules - @nodoc_methods - percent_doc = doc_items.to_f / items * 100 + percent_doc = doc_items.to_f / items * 100 if items.nonzero? puts "Files: %5d" % @num_files puts "Classes: %5d (%5d undocumented)" % [num_classes, nodoc_classes] @@ -97,7 +97,7 @@ class RDoc::Stats [@num_constants, @nodoc_constants] puts "Modules: %5d (%5d undocumented)" % [num_modules, nodoc_modules] puts "Methods: %5d (%5d undocumented)" % [@num_methods, @nodoc_methods] - puts "%6.2f%% documented" % percent_doc + puts "%6.2f%% documented" % percent_doc if percent_doc puts puts "Elapsed: %0.1fs" % (Time.now - @start) end