diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
commit | e2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch) | |
tree | 942e66e071e759c7db670a42daeac26c7437f25b /lib/rdoc/stats.rb | |
parent | 90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff) | |
download | ruby-e2efe8e81dc7e9fce40b024df6a20bbf4b830350.tar.gz |
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/stats.rb')
-rw-r--r-- | lib/rdoc/stats.rb | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/lib/rdoc/stats.rb b/lib/rdoc/stats.rb index e0af445539..70e361feaa 100644 --- a/lib/rdoc/stats.rb +++ b/lib/rdoc/stats.rb @@ -24,6 +24,7 @@ class RDoc::Stats @files_so_far = 0 @num_files = num_files @fully_documented = nil + @percent_doc = nil @start = Time.now @@ -215,7 +216,9 @@ class RDoc::Stats report << nil cm.each_constant do |constant| - next if constant.documented? + # TODO constant aliases are listed in the summary but not reported + # figure out what to do here + next if constant.documented? || constant.is_alias_for report << " # in file #{constant.file.full_name}" report << " #{constant.name} = nil" end @@ -255,22 +258,36 @@ class RDoc::Stats def summary calculate + num_width = [@num_files, @num_items].max.to_s.length + nodoc_width = [ + @undoc_attributes, + @undoc_classes, + @undoc_constants, + @undoc_items, + @undoc_methods, + @undoc_modules, + ].max.to_s.length + report = [] - report << 'Files: %5d' % @num_files + report << 'Files: %*d' % [num_width, @num_files] + report << nil - report << 'Classes: %5d (%5d undocumented)' % [@num_classes, - @undoc_classes] - report << 'Modules: %5d (%5d undocumented)' % [@num_modules, - @undoc_modules] - report << 'Constants: %5d (%5d undocumented)' % [@num_constants, - @undoc_constants] - report << 'Attributes: %5d (%5d undocumented)' % [@num_attributes, - @undoc_attributes] - report << 'Methods: %5d (%5d undocumented)' % [@num_methods, - @undoc_methods] + + report << 'Classes: %*d (%*d undocumented)' % [ + num_width, @num_classes, nodoc_width, @undoc_classes] + report << 'Modules: %*d (%*d undocumented)' % [ + num_width, @num_modules, nodoc_width, @undoc_modules] + report << 'Constants: %*d (%*d undocumented)' % [ + num_width, @num_constants, nodoc_width, @undoc_constants] + report << 'Attributes: %*d (%*d undocumented)' % [ + num_width, @num_attributes, nodoc_width, @undoc_attributes] + report << 'Methods: %*d (%*d undocumented)' % [ + num_width, @num_methods, nodoc_width, @undoc_methods] + report << nil - report << 'Total: %5d (%5d undocumented)' % [@num_items, - @undoc_items] + + report << 'Total: %*d (%*d undocumented)' % [ + num_width, @num_items, nodoc_width, @undoc_items] report << '%6.2f%% documented' % @percent_doc if @percent_doc report << nil |