mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fcb0b1f503
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
25 lines
463 B
Ruby
25 lines
463 B
Ruby
require 'rdoc'
|
|
|
|
##
|
|
# Simple stats collector
|
|
|
|
class RDoc::Stats
|
|
|
|
attr_accessor :num_files, :num_classes, :num_modules, :num_methods
|
|
|
|
def initialize
|
|
@num_files = @num_classes = @num_modules = @num_methods = 0
|
|
@start = Time.now
|
|
end
|
|
|
|
def print
|
|
puts "Files: #@num_files"
|
|
puts "Classes: #@num_classes"
|
|
puts "Modules: #@num_modules"
|
|
puts "Methods: #@num_methods"
|
|
puts "Elapsed: " + sprintf("%0.3fs", Time.now - @start)
|
|
end
|
|
|
|
end
|
|
|
|
|