mega-max-hub 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/mega-max-hub.gemspec +11 -0
- data/rdoc-8.0.0/CONTRIBUTING.md +195 -0
- data/rdoc-8.0.0/CVE-2013-0256.rdoc +49 -0
- data/rdoc-8.0.0/History.rdoc +1668 -0
- data/rdoc-8.0.0/LEGAL.rdoc +56 -0
- data/rdoc-8.0.0/LICENSE.rdoc +63 -0
- data/rdoc-8.0.0/README.md +236 -0
- data/rdoc-8.0.0/RI.md +842 -0
- data/rdoc-8.0.0/TODO.rdoc +60 -0
- data/rdoc-8.0.0/doc/markup_reference/markdown.md +659 -0
- data/rdoc-8.0.0/doc/markup_reference/rdoc.rdoc +1169 -0
- data/rdoc-8.0.0/exe/rdoc +43 -0
- data/rdoc-8.0.0/exe/ri +12 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/alias.rb +98 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/any_method.rb +387 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/attr.rb +178 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/class_module.rb +969 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/constant.rb +221 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context/section.rb +182 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context.rb +1238 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/extend.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/include.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/method_attr.rb +417 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/mixin.rb +123 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_class.rb +92 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_module.rb +73 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/require.rb +51 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/single_class.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/top_level.rb +286 -0
- data/rdoc-8.0.0/lib/rdoc/code_object.rb +393 -0
- data/rdoc-8.0.0/lib/rdoc/code_objects.rb +5 -0
- data/rdoc-8.0.0/lib/rdoc/comment.rb +353 -0
- data/rdoc-8.0.0/lib/rdoc/cross_reference.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/encoding.rb +120 -0
- data/rdoc-8.0.0/lib/rdoc/erb_partial.rb +18 -0
- data/rdoc-8.0.0/lib/rdoc/erbio.rb +37 -0
- data/rdoc-8.0.0/lib/rdoc/generator/aliki.rb +200 -0
- data/rdoc-8.0.0/lib/rdoc/generator/darkfish.rb +824 -0
- data/rdoc-8.0.0/lib/rdoc/generator/json_index.rb +284 -0
- data/rdoc-8.0.0/lib/rdoc/generator/markup.rb +196 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot.rb +94 -0
- data/rdoc-8.0.0/lib/rdoc/generator/ri.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/class.rhtml +220 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +701 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/index.rhtml +24 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +140 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/search.js +120 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/page.rhtml +19 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +72 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/searcher.js +271 -0
- data/rdoc-8.0.0/lib/rdoc/generator.rb +52 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/locale.rb +102 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/text.rb +126 -0
- data/rdoc-8.0.0/lib/rdoc/i18n.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc/known_classes.rb +74 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/entities.rb +2131 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.kpeg +21 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.rb +454 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.kpeg +1315 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.rb +16865 -0
- data/rdoc-8.0.0/lib/rdoc/markup/blank_line.rb +29 -0
- data/rdoc-8.0.0/lib/rdoc/markup/block_quote.rb +14 -0
- data/rdoc-8.0.0/lib/rdoc/markup/document.rb +164 -0
- data/rdoc-8.0.0/lib/rdoc/markup/element.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/markup/formatter.rb +285 -0
- data/rdoc-8.0.0/lib/rdoc/markup/hard_break.rb +34 -0
- data/rdoc-8.0.0/lib/rdoc/markup/heading.rb +170 -0
- data/rdoc-8.0.0/lib/rdoc/markup/include.rb +42 -0
- data/rdoc-8.0.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
- data/rdoc-8.0.0/lib/rdoc/markup/inline_parser.rb +312 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list.rb +101 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list_item.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/markup/paragraph.rb +28 -0
- data/rdoc-8.0.0/lib/rdoc/markup/parser.rb +585 -0
- data/rdoc-8.0.0/lib/rdoc/markup/pre_process.rb +317 -0
- data/rdoc-8.0.0/lib/rdoc/markup/raw.rb +66 -0
- data/rdoc-8.0.0/lib/rdoc/markup/rule.rb +20 -0
- data/rdoc-8.0.0/lib/rdoc/markup/table.rb +64 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_ansi.rb +144 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_bs.rb +86 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html.rb +682 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_crossref.rb +261 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_joined_paragraph.rb +41 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_label.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_markdown.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_rdoc.rb +421 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_test.rb +77 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_tt_only.rb +107 -0
- data/rdoc-8.0.0/lib/rdoc/markup/verbatim.rb +83 -0
- data/rdoc-8.0.0/lib/rdoc/markup.rb +219 -0
- data/rdoc-8.0.0/lib/rdoc/options.rb +1412 -0
- data/rdoc-8.0.0/lib/rdoc/parser/c.rb +1227 -0
- data/rdoc-8.0.0/lib/rdoc/parser/changelog.rb +379 -0
- data/rdoc-8.0.0/lib/rdoc/parser/markdown.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rbs.rb +275 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rd.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby.rb +1266 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/rdoc-8.0.0/lib/rdoc/parser/simple.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/parser/text.rb +11 -0
- data/rdoc-8.0.0/lib/rdoc/parser.rb +298 -0
- data/rdoc-8.0.0/lib/rdoc/rbs_helper.rb +186 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.rb +1706 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.ry +643 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.rb +1854 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.ry +593 -0
- data/rdoc-8.0.0/lib/rdoc/rd.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/rdoc.rb +724 -0
- data/rdoc-8.0.0/lib/rdoc/ri/driver.rb +1572 -0
- data/rdoc-8.0.0/lib/rdoc/ri/formatter.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/paths.rb +171 -0
- data/rdoc-8.0.0/lib/rdoc/ri/servlet.rb +452 -0
- data/rdoc-8.0.0/lib/rdoc/ri/store.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/task.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/ri.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/rubygems_hook.rb +327 -0
- data/rdoc-8.0.0/lib/rdoc/server.rb +460 -0
- data/rdoc-8.0.0/lib/rdoc/stats/normal.rb +58 -0
- data/rdoc-8.0.0/lib/rdoc/stats/quiet.rb +59 -0
- data/rdoc-8.0.0/lib/rdoc/stats/verbose.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/stats.rb +484 -0
- data/rdoc-8.0.0/lib/rdoc/store.rb +1205 -0
- data/rdoc-8.0.0/lib/rdoc/task.rb +355 -0
- data/rdoc-8.0.0/lib/rdoc/text.rb +244 -0
- data/rdoc-8.0.0/lib/rdoc/token_stream.rb +104 -0
- data/rdoc-8.0.0/lib/rdoc/tom_doc.rb +257 -0
- data/rdoc-8.0.0/lib/rdoc/version.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc.rb +239 -0
- data/rdoc-8.0.0/lib/rubygems_plugin.rb +14 -0
- data/rdoc-8.0.0/man/ri.1 +249 -0
- data/rdoc-8.0.0/rdoc-logo.svg +43 -0
- data/rdoc-8.0.0/rdoc.gemspec +74 -0
- metadata +256 -0
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# RDoc statistics collector which prints a summary and report of a project's
|
|
4
|
+
# documentation totals.
|
|
5
|
+
|
|
6
|
+
class RDoc::Stats
|
|
7
|
+
|
|
8
|
+
include RDoc::Text
|
|
9
|
+
|
|
10
|
+
##
|
|
11
|
+
# Display order for item types in the coverage report
|
|
12
|
+
|
|
13
|
+
TYPE_ORDER = %w[Class Module Constant Attribute Method].freeze
|
|
14
|
+
|
|
15
|
+
##
|
|
16
|
+
# Message displayed when all items are documented
|
|
17
|
+
|
|
18
|
+
GREAT_JOB_MESSAGE = <<~MSG
|
|
19
|
+
100% documentation!
|
|
20
|
+
Great Job!
|
|
21
|
+
MSG
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
# Output level for the coverage report
|
|
25
|
+
|
|
26
|
+
attr_reader :coverage_level
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# Count of files parsed during parsing
|
|
30
|
+
|
|
31
|
+
attr_reader :files_so_far
|
|
32
|
+
|
|
33
|
+
##
|
|
34
|
+
# Total number of files found
|
|
35
|
+
|
|
36
|
+
attr_reader :num_files
|
|
37
|
+
|
|
38
|
+
##
|
|
39
|
+
# Creates a new Stats that will have +num_files+. +verbosity+ defaults to 1
|
|
40
|
+
# which will create an RDoc::Stats::Normal outputter.
|
|
41
|
+
|
|
42
|
+
def initialize(store, num_files, verbosity = 1)
|
|
43
|
+
@num_files = num_files
|
|
44
|
+
@store = store
|
|
45
|
+
|
|
46
|
+
@coverage_level = 0
|
|
47
|
+
@doc_items = nil
|
|
48
|
+
@files_so_far = 0
|
|
49
|
+
@fully_documented = false
|
|
50
|
+
@num_params = 0
|
|
51
|
+
@percent_doc = nil
|
|
52
|
+
@start = Time.now
|
|
53
|
+
@undoc_params = 0
|
|
54
|
+
|
|
55
|
+
self.verbosity = verbosity
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
##
|
|
59
|
+
# Sets the verbosity level, rebuilding the display outputter.
|
|
60
|
+
|
|
61
|
+
def verbosity=(verbosity)
|
|
62
|
+
@display = case verbosity
|
|
63
|
+
when 0 then Quiet.new @num_files
|
|
64
|
+
when 1 then Normal.new @num_files
|
|
65
|
+
else Verbose.new @num_files
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
##
|
|
70
|
+
# Records the parsing of an alias +as+.
|
|
71
|
+
|
|
72
|
+
def add_alias(as)
|
|
73
|
+
@display.print_alias as
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
##
|
|
77
|
+
# Records the parsing of an attribute +attribute+
|
|
78
|
+
|
|
79
|
+
def add_attribute(attribute)
|
|
80
|
+
@display.print_attribute attribute
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
##
|
|
84
|
+
# Records the parsing of a class +klass+
|
|
85
|
+
|
|
86
|
+
def add_class(klass)
|
|
87
|
+
@display.print_class klass
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
##
|
|
91
|
+
# Records the parsing of +constant+
|
|
92
|
+
|
|
93
|
+
def add_constant(constant)
|
|
94
|
+
@display.print_constant constant
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
##
|
|
98
|
+
# Records the parsing of +file+
|
|
99
|
+
|
|
100
|
+
def add_file(file)
|
|
101
|
+
@files_so_far += 1
|
|
102
|
+
@display.print_file @files_so_far, file
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
##
|
|
106
|
+
# Records the parsing of +method+
|
|
107
|
+
|
|
108
|
+
def add_method(method)
|
|
109
|
+
@display.print_method method
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
##
|
|
113
|
+
# Records the parsing of a module +mod+
|
|
114
|
+
|
|
115
|
+
def add_module(mod)
|
|
116
|
+
@display.print_module mod
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
##
|
|
120
|
+
# Call this to mark the beginning of parsing for display purposes
|
|
121
|
+
|
|
122
|
+
def begin_adding
|
|
123
|
+
@display.begin_adding
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
##
|
|
127
|
+
# Calculates documentation totals and percentages for classes, modules,
|
|
128
|
+
# constants, attributes and methods.
|
|
129
|
+
|
|
130
|
+
def calculate
|
|
131
|
+
return if @doc_items
|
|
132
|
+
|
|
133
|
+
ucm = @store.unique_classes_and_modules
|
|
134
|
+
|
|
135
|
+
classes = @store.unique_classes.reject { |cm| cm.full_name == 'Object' }
|
|
136
|
+
|
|
137
|
+
constants = []
|
|
138
|
+
ucm.each { |cm| constants.concat cm.constants }
|
|
139
|
+
|
|
140
|
+
methods = []
|
|
141
|
+
ucm.each { |cm| methods.concat cm.method_list }
|
|
142
|
+
|
|
143
|
+
attributes = []
|
|
144
|
+
ucm.each { |cm| attributes.concat cm.attributes }
|
|
145
|
+
|
|
146
|
+
@num_attributes, @undoc_attributes = doc_stats attributes
|
|
147
|
+
@num_classes, @undoc_classes = doc_stats classes
|
|
148
|
+
@num_constants, @undoc_constants = doc_stats constants
|
|
149
|
+
@num_methods, @undoc_methods = doc_stats methods
|
|
150
|
+
@num_modules, @undoc_modules = doc_stats @store.unique_modules
|
|
151
|
+
|
|
152
|
+
@num_items =
|
|
153
|
+
@num_attributes +
|
|
154
|
+
@num_classes +
|
|
155
|
+
@num_constants +
|
|
156
|
+
@num_methods +
|
|
157
|
+
@num_modules +
|
|
158
|
+
@num_params
|
|
159
|
+
|
|
160
|
+
@undoc_items =
|
|
161
|
+
@undoc_attributes +
|
|
162
|
+
@undoc_classes +
|
|
163
|
+
@undoc_constants +
|
|
164
|
+
@undoc_methods +
|
|
165
|
+
@undoc_modules +
|
|
166
|
+
@undoc_params
|
|
167
|
+
|
|
168
|
+
@doc_items = @num_items - @undoc_items
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
##
|
|
172
|
+
# Sets coverage report level. Accepted values are:
|
|
173
|
+
#
|
|
174
|
+
# false or nil:: No report
|
|
175
|
+
# 0:: Classes, modules, constants, attributes, methods
|
|
176
|
+
# 1:: Level 0 + method parameters
|
|
177
|
+
|
|
178
|
+
def coverage_level=(level)
|
|
179
|
+
level = -1 unless level
|
|
180
|
+
|
|
181
|
+
@coverage_level = level
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
##
|
|
185
|
+
# Returns the length and number of undocumented items in +collection+.
|
|
186
|
+
|
|
187
|
+
def doc_stats(collection)
|
|
188
|
+
visible = collection.select { |item| item.display? }
|
|
189
|
+
[visible.length, visible.count { |item| not item.documented? }]
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
##
|
|
193
|
+
# Call this to mark the end of parsing for display purposes
|
|
194
|
+
|
|
195
|
+
def done_adding
|
|
196
|
+
@display.done_adding
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
##
|
|
200
|
+
# The documentation status of this project. +true+ when 100%, +false+ when
|
|
201
|
+
# less than 100% and +nil+ when unknown.
|
|
202
|
+
#
|
|
203
|
+
# Set by calling #calculate
|
|
204
|
+
|
|
205
|
+
def fully_documented?
|
|
206
|
+
@fully_documented
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
##
|
|
210
|
+
# Calculates the percentage of items documented.
|
|
211
|
+
|
|
212
|
+
def percent_doc
|
|
213
|
+
return @percent_doc if @percent_doc
|
|
214
|
+
|
|
215
|
+
@fully_documented = (@num_items - @doc_items) == 0
|
|
216
|
+
|
|
217
|
+
@percent_doc = @doc_items.to_f / @num_items * 100 if @num_items.nonzero?
|
|
218
|
+
@percent_doc ||= 0
|
|
219
|
+
|
|
220
|
+
@percent_doc
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
##
|
|
224
|
+
# Returns a report on which items are not documented
|
|
225
|
+
|
|
226
|
+
def report
|
|
227
|
+
if @coverage_level > 0 then
|
|
228
|
+
extend RDoc::Text
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if @coverage_level.zero? then
|
|
232
|
+
calculate
|
|
233
|
+
|
|
234
|
+
return GREAT_JOB_MESSAGE if @num_items == @doc_items
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
items, empty_classes = collect_undocumented_items
|
|
238
|
+
|
|
239
|
+
if @coverage_level > 0 then
|
|
240
|
+
calculate
|
|
241
|
+
|
|
242
|
+
return GREAT_JOB_MESSAGE if @num_items == @doc_items
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
report = +""
|
|
246
|
+
report << "The following items are not documented:\n\n"
|
|
247
|
+
|
|
248
|
+
# Referenced-but-empty classes
|
|
249
|
+
empty_classes.each do |cm|
|
|
250
|
+
report << "#{cm.full_name} is referenced but empty.\n"
|
|
251
|
+
report << "It probably came from another project. I'm sorry I'm holding it against you.\n\n"
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Group items by file, then by type
|
|
255
|
+
by_file = items.group_by { |item| item[:file] }
|
|
256
|
+
|
|
257
|
+
by_file.sort_by { |file, _| file }.each do |file, file_items|
|
|
258
|
+
report << "#{file}:\n"
|
|
259
|
+
|
|
260
|
+
by_type = file_items.group_by { |item| item[:type] }
|
|
261
|
+
|
|
262
|
+
TYPE_ORDER.each do |type|
|
|
263
|
+
next unless by_type[type]
|
|
264
|
+
|
|
265
|
+
report << " #{type}:\n"
|
|
266
|
+
|
|
267
|
+
sorted = by_type[type].sort_by { |item| [item[:line] || 0, item[:name]] }
|
|
268
|
+
name_width = sorted.reduce(0) { |max, item| item[:line] && item[:name].length > max ? item[:name].length : max }
|
|
269
|
+
|
|
270
|
+
sorted.each do |item|
|
|
271
|
+
if item[:line]
|
|
272
|
+
report << " %-*s %s:%d\n" % [name_width, item[:name], item[:file], item[:line]]
|
|
273
|
+
else
|
|
274
|
+
report << " #{item[:name]}\n"
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if item[:undoc_params]
|
|
278
|
+
report << " Undocumented params: #{item[:undoc_params].join(', ')}\n"
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
report << "\n"
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
report
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
##
|
|
290
|
+
# Collects all undocumented items across all classes and modules.
|
|
291
|
+
# Returns [items, empty_classes] where items is an Array of Hashes
|
|
292
|
+
# with keys :type, :name, :file, :line, and empty_classes is an
|
|
293
|
+
# Array of ClassModule objects that are referenced but have no files.
|
|
294
|
+
|
|
295
|
+
def collect_undocumented_items
|
|
296
|
+
empty_classes = []
|
|
297
|
+
items = []
|
|
298
|
+
|
|
299
|
+
@store.unique_classes_and_modules.each do |class_module|
|
|
300
|
+
next unless class_module.display?
|
|
301
|
+
|
|
302
|
+
if class_module.in_files.empty?
|
|
303
|
+
empty_classes << class_module
|
|
304
|
+
next
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
unless class_module.documented? || class_module.full_name == 'Object'
|
|
308
|
+
collect_undocumented_class_module(class_module, items)
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
collect_undocumented_constants(class_module, items)
|
|
312
|
+
collect_undocumented_attributes(class_module, items)
|
|
313
|
+
collect_undocumented_methods(class_module, items)
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
[items, empty_classes]
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
##
|
|
320
|
+
# Collects undocumented classes or modules from +class_module+ into +items+.
|
|
321
|
+
# Reopened classes/modules are reported in every file they appear in.
|
|
322
|
+
|
|
323
|
+
def collect_undocumented_class_module(class_module, items)
|
|
324
|
+
class_module.in_files.map(&:full_name).uniq.each do |file|
|
|
325
|
+
items << {
|
|
326
|
+
type: class_module.type.capitalize,
|
|
327
|
+
name: class_module.full_name,
|
|
328
|
+
file: file,
|
|
329
|
+
line: nil,
|
|
330
|
+
}
|
|
331
|
+
end
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
##
|
|
335
|
+
# Collects undocumented constants from +class_module+ into +items+.
|
|
336
|
+
|
|
337
|
+
def collect_undocumented_constants(class_module, items)
|
|
338
|
+
class_module.constants.each do |constant|
|
|
339
|
+
next unless constant.display?
|
|
340
|
+
next if constant.documented? || constant.is_alias_for
|
|
341
|
+
|
|
342
|
+
file = constant.file&.full_name
|
|
343
|
+
next unless file
|
|
344
|
+
|
|
345
|
+
items << {
|
|
346
|
+
type: "Constant",
|
|
347
|
+
name: constant.full_name,
|
|
348
|
+
file: file,
|
|
349
|
+
line: constant.line,
|
|
350
|
+
}
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
##
|
|
355
|
+
# Collects undocumented attributes from +class_module+ into +items+.
|
|
356
|
+
|
|
357
|
+
def collect_undocumented_attributes(class_module, items)
|
|
358
|
+
class_module.attributes.each do |attr|
|
|
359
|
+
next unless attr.display?
|
|
360
|
+
next if attr.documented?
|
|
361
|
+
|
|
362
|
+
file = attr.file&.full_name
|
|
363
|
+
next unless file
|
|
364
|
+
|
|
365
|
+
scope = attr.singleton ? "." : "#"
|
|
366
|
+
items << {
|
|
367
|
+
type: "Attribute",
|
|
368
|
+
name: "#{class_module.full_name}#{scope}#{attr.name}",
|
|
369
|
+
file: file,
|
|
370
|
+
line: attr.line,
|
|
371
|
+
}
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
##
|
|
376
|
+
# Collects undocumented methods from +class_module+ into +items+.
|
|
377
|
+
# At coverage level > 0, also counts undocumented parameters.
|
|
378
|
+
|
|
379
|
+
def collect_undocumented_methods(class_module, items)
|
|
380
|
+
class_module.each_method do |method|
|
|
381
|
+
next unless method.display?
|
|
382
|
+
next if method.documented? && @coverage_level.zero?
|
|
383
|
+
|
|
384
|
+
undoc_param_names = nil
|
|
385
|
+
|
|
386
|
+
if @coverage_level > 0
|
|
387
|
+
params, undoc = undoc_params method
|
|
388
|
+
@num_params += params
|
|
389
|
+
|
|
390
|
+
unless undoc.empty?
|
|
391
|
+
@undoc_params += undoc.length
|
|
392
|
+
undoc_param_names = undoc
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
next if method.documented? && !undoc_param_names
|
|
397
|
+
|
|
398
|
+
file = method.file&.full_name
|
|
399
|
+
next unless file
|
|
400
|
+
|
|
401
|
+
scope = method.singleton ? "." : "#"
|
|
402
|
+
item = {
|
|
403
|
+
type: "Method",
|
|
404
|
+
name: "#{class_module.full_name}#{scope}#{method.name}",
|
|
405
|
+
file: file,
|
|
406
|
+
line: method.line,
|
|
407
|
+
}
|
|
408
|
+
item[:undoc_params] = undoc_param_names if undoc_param_names
|
|
409
|
+
|
|
410
|
+
items << item
|
|
411
|
+
end
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
##
|
|
415
|
+
# Returns a summary of the collected statistics.
|
|
416
|
+
|
|
417
|
+
def summary
|
|
418
|
+
calculate
|
|
419
|
+
|
|
420
|
+
num_width = [@num_files, @num_items].max.to_s.length
|
|
421
|
+
undoc_width = [
|
|
422
|
+
@undoc_attributes,
|
|
423
|
+
@undoc_classes,
|
|
424
|
+
@undoc_constants,
|
|
425
|
+
@undoc_items,
|
|
426
|
+
@undoc_methods,
|
|
427
|
+
@undoc_modules,
|
|
428
|
+
@undoc_params,
|
|
429
|
+
].max.to_s.length
|
|
430
|
+
|
|
431
|
+
report = +""
|
|
432
|
+
|
|
433
|
+
report << "Files: %*d\n" % [num_width, @num_files]
|
|
434
|
+
report << "\n"
|
|
435
|
+
report << "Classes: %*d (%*d undocumented)\n" % [
|
|
436
|
+
num_width, @num_classes, undoc_width, @undoc_classes]
|
|
437
|
+
report << "Modules: %*d (%*d undocumented)\n" % [
|
|
438
|
+
num_width, @num_modules, undoc_width, @undoc_modules]
|
|
439
|
+
report << "Constants: %*d (%*d undocumented)\n" % [
|
|
440
|
+
num_width, @num_constants, undoc_width, @undoc_constants]
|
|
441
|
+
report << "Attributes: %*d (%*d undocumented)\n" % [
|
|
442
|
+
num_width, @num_attributes, undoc_width, @undoc_attributes]
|
|
443
|
+
report << "Methods: %*d (%*d undocumented)\n" % [
|
|
444
|
+
num_width, @num_methods, undoc_width, @undoc_methods]
|
|
445
|
+
report << "Parameters: %*d (%*d undocumented)\n" % [
|
|
446
|
+
num_width, @num_params, undoc_width, @undoc_params] if
|
|
447
|
+
@coverage_level > 0
|
|
448
|
+
report << "\n"
|
|
449
|
+
report << "Total: %*d (%*d undocumented)\n" % [
|
|
450
|
+
num_width, @num_items, undoc_width, @undoc_items]
|
|
451
|
+
report << "%6.2f%% documented\n" % percent_doc
|
|
452
|
+
report << "\n"
|
|
453
|
+
report << "Elapsed: %0.1fs\n" % (Time.now - @start)
|
|
454
|
+
|
|
455
|
+
report
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
##
|
|
459
|
+
# Determines which parameters in +method+ were not documented. Returns a
|
|
460
|
+
# total parameter count and an Array of undocumented methods.
|
|
461
|
+
|
|
462
|
+
def undoc_params(method)
|
|
463
|
+
@formatter ||= RDoc::Markup::ToTtOnly.new
|
|
464
|
+
|
|
465
|
+
params = method.param_list
|
|
466
|
+
|
|
467
|
+
params = params.map { |param| param.gsub(/^\*\*?/, '') }
|
|
468
|
+
|
|
469
|
+
return 0, [] if params.empty?
|
|
470
|
+
|
|
471
|
+
document = parse method.comment
|
|
472
|
+
|
|
473
|
+
tts = document.accept @formatter
|
|
474
|
+
|
|
475
|
+
undoc = params - tts
|
|
476
|
+
|
|
477
|
+
[params.length, undoc]
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
autoload :Quiet, "#{__dir__}/stats/quiet"
|
|
481
|
+
autoload :Normal, "#{__dir__}/stats/normal"
|
|
482
|
+
autoload :Verbose, "#{__dir__}/stats/verbose"
|
|
483
|
+
|
|
484
|
+
end
|