summaryrefslogtreecommitdiff
path: root/trunk/lib/rdoc/stats.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:13:14 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:13:14 +0000
commitd0233291bc8a5068e52c69c210e5979e5324b5bc (patch)
tree7d9459449c33792c63eeb7baa071e76352e0baab /trunk/lib/rdoc/stats.rb
parent0dc342de848a642ecce8db697b8fecd83a63e117 (diff)
parent72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff)
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/lib/rdoc/stats.rb')
-rw-r--r--trunk/lib/rdoc/stats.rb115
1 files changed, 0 insertions, 115 deletions
diff --git a/trunk/lib/rdoc/stats.rb b/trunk/lib/rdoc/stats.rb
deleted file mode 100644
index e18e3c23d7..0000000000
--- a/trunk/lib/rdoc/stats.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-require 'rdoc'
-
-##
-# Simple stats collector
-
-class RDoc::Stats
-
- attr_reader :num_classes
- attr_reader :num_files
- attr_reader :num_methods
- attr_reader :num_modules
-
- def initialize(verbosity = 1)
- @num_classes = 0
- @num_files = 0
- @num_methods = 0
- @num_modules = 0
-
- @start = Time.now
-
- @display = case verbosity
- when 0 then Quiet.new
- when 1 then Normal.new
- else Verbose.new
- end
- end
-
- def add_alias(as)
- @display.print_alias as
- @num_methods += 1
- end
-
- def add_class(klass)
- @display.print_class klass
- @num_classes += 1
- end
-
- def add_file(file)
- @display.print_file file
- @num_files += 1
- end
-
- def add_method(method)
- @display.print_method method
- @num_methods += 1
- end
-
- def add_module(mod)
- @display.print_module mod
- @num_modules += 1
- end
-
- def print
- puts "Files: #@num_files"
- puts "Classes: #@num_classes"
- puts "Modules: #@num_modules"
- puts "Methods: #@num_methods"
- puts "Elapsed: " + sprintf("%0.1fs", Time.now - @start)
- end
-
- class Quiet
- def print_alias(*) end
- def print_class(*) end
- def print_file(*) end
- def print_method(*) end
- def print_module(*) end
- end
-
- class Normal
- def print_alias(as)
- print 'a'
- end
-
- def print_class(klass)
- print 'C'
- end
-
- def print_file(file)
- print "\n#{file}: "
- end
-
- def print_method(method)
- print 'm'
- end
-
- def print_module(mod)
- print 'M'
- end
- end
-
- class Verbose
- def print_alias(as)
- puts "\t\talias #{as.new_name} #{as.old_name}"
- end
-
- def print_class(klass)
- puts "\tclass #{klass.full_name}"
- end
-
- def print_file(file)
- puts file
- end
-
- def print_method(method)
- puts "\t\t#{method.singleton ? '::' : '#'}#{method.name}"
- end
-
- def print_module(mod)
- puts "\tmodule #{mod.full_name}"
- end
- end
-
-end
-
-