yard 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

Files changed (264) hide show
  1. data/{LICENSE.txt → LICENSE} +1 -1
  2. data/README +211 -0
  3. data/Rakefile +31 -0
  4. data/benchmarks/builtins_vs_eval.rb +23 -0
  5. data/benchmarks/erb_vs_erubis.rb +53 -0
  6. data/benchmarks/generation.rb +37 -0
  7. data/benchmarks/parsing.rb +33 -0
  8. data/bin/view_generator +17 -0
  9. data/bin/yard-graph +4 -0
  10. data/bin/yardoc +1 -93
  11. data/bin/yri +12 -3
  12. data/lib/yard.rb +10 -5
  13. data/lib/yard/autoload.rb +116 -0
  14. data/lib/yard/cli/yard_graph.rb +86 -0
  15. data/lib/yard/cli/yardoc.rb +131 -0
  16. data/lib/yard/code_objects/base.rb +321 -0
  17. data/lib/yard/code_objects/class_object.rb +89 -0
  18. data/lib/yard/code_objects/class_variable_object.rb +4 -0
  19. data/lib/yard/code_objects/constant_object.rb +4 -0
  20. data/lib/yard/code_objects/method_object.rb +51 -0
  21. data/lib/yard/code_objects/module_object.rb +4 -0
  22. data/lib/yard/code_objects/namespace_object.rb +88 -0
  23. data/lib/yard/code_objects/proxy.rb +183 -0
  24. data/lib/yard/code_objects/root_object.rb +8 -0
  25. data/lib/yard/core_ext/file.rb +26 -0
  26. data/lib/yard/core_ext/logger.rb +5 -0
  27. data/lib/yard/core_ext/module.rb +9 -0
  28. data/lib/yard/core_ext/string.rb +13 -0
  29. data/lib/yard/core_ext/symbol_hash.rb +24 -0
  30. data/lib/yard/generators/attributes_generator.rb +22 -0
  31. data/lib/yard/generators/base.rb +285 -0
  32. data/lib/yard/generators/class_generator.rb +25 -0
  33. data/lib/yard/generators/constants_generator.rb +73 -0
  34. data/lib/yard/generators/constructor_generator.rb +25 -0
  35. data/lib/yard/generators/deprecated_generator.rb +15 -0
  36. data/lib/yard/generators/docstring_generator.rb +15 -0
  37. data/lib/yard/generators/full_doc_generator.rb +59 -0
  38. data/lib/yard/generators/helpers/base_helper.rb +52 -0
  39. data/lib/yard/generators/helpers/filter_helper.rb +21 -0
  40. data/lib/yard/generators/helpers/html_helper.rb +137 -0
  41. data/lib/yard/generators/helpers/method_helper.rb +27 -0
  42. data/lib/yard/generators/helpers/uml_helper.rb +16 -0
  43. data/lib/yard/generators/inheritance_generator.rb +16 -0
  44. data/lib/yard/generators/method_details_generator.rb +18 -0
  45. data/lib/yard/generators/method_generator.rb +31 -0
  46. data/lib/yard/generators/method_listing_generator.rb +105 -0
  47. data/lib/yard/generators/method_missing_generator.rb +25 -0
  48. data/lib/yard/generators/method_signature_generator.rb +19 -0
  49. data/lib/yard/generators/method_summary_generator.rb +21 -0
  50. data/lib/yard/generators/mixins_generator.rb +15 -0
  51. data/lib/yard/generators/module_generator.rb +22 -0
  52. data/lib/yard/generators/quick_doc_generator.rb +31 -0
  53. data/lib/yard/generators/source_generator.rb +26 -0
  54. data/lib/yard/generators/tags_generator.rb +50 -0
  55. data/lib/yard/generators/uml_generator.rb +92 -0
  56. data/lib/yard/generators/visibility_group_generator.rb +26 -0
  57. data/lib/yard/handlers/alias_handler.rb +32 -0
  58. data/lib/yard/handlers/attribute_handler.rb +54 -0
  59. data/lib/yard/handlers/base.rb +509 -0
  60. data/lib/yard/handlers/class_handler.rb +44 -0
  61. data/lib/yard/handlers/class_variable_handler.rb +13 -0
  62. data/lib/yard/handlers/constant_handler.rb +13 -0
  63. data/lib/yard/handlers/exception_handler.rb +12 -0
  64. data/lib/yard/handlers/method_handler.rb +27 -0
  65. data/lib/yard/handlers/mixin_handler.rb +16 -0
  66. data/lib/yard/handlers/module_handler.rb +9 -0
  67. data/lib/yard/handlers/visibility_handler.rb +14 -0
  68. data/lib/yard/handlers/yield_handler.rb +26 -0
  69. data/lib/yard/logging.rb +27 -0
  70. data/lib/yard/parser/ruby_lex.rb +1344 -0
  71. data/lib/yard/parser/source_parser.rb +109 -0
  72. data/lib/yard/parser/statement.rb +36 -0
  73. data/lib/yard/parser/statement_list.rb +167 -0
  74. data/lib/yard/parser/token_list.rb +58 -0
  75. data/lib/yard/rake/yardoc_task.rb +30 -0
  76. data/lib/yard/registry.rb +136 -0
  77. data/lib/yard/serializers/base.rb +16 -0
  78. data/lib/yard/serializers/file_system_serializer.rb +48 -0
  79. data/lib/yard/serializers/process_serializer.rb +14 -0
  80. data/lib/yard/serializers/stdout_serializer.rb +21 -0
  81. data/lib/yard/tags/default_factory.rb +98 -0
  82. data/lib/yard/tags/library.rb +109 -0
  83. data/lib/yard/tags/merbdoc_factory.rb +47 -0
  84. data/lib/yard/tags/tag.rb +35 -0
  85. data/spec/code_objects/base_spec.rb +219 -0
  86. data/spec/code_objects/class_object_spec.rb +176 -0
  87. data/spec/code_objects/code_object_list_spec.rb +33 -0
  88. data/spec/code_objects/constants_spec.rb +79 -0
  89. data/spec/code_objects/method_object_spec.rb +30 -0
  90. data/spec/code_objects/module_object_spec.rb +73 -0
  91. data/spec/code_objects/namespace_object_spec.rb +129 -0
  92. data/spec/code_objects/proxy_spec.rb +80 -0
  93. data/spec/code_objects/spec_helper.rb +3 -0
  94. data/spec/core_ext/file_spec.rb +20 -0
  95. data/spec/core_ext/string_spec.rb +4 -0
  96. data/spec/core_ext/symbol_hash_spec.rb +80 -0
  97. data/spec/generators/base_spec.rb +64 -0
  98. data/spec/generators/helpers/base_helper_spec.rb +15 -0
  99. data/spec/generators/helpers/html_helper_spec.rb +56 -0
  100. data/spec/generators/quick_doc_generator_spec.rb +13 -0
  101. data/spec/handlers/alias_handler_spec.rb +50 -0
  102. data/spec/handlers/attribute_handler_spec.rb +78 -0
  103. data/spec/handlers/base_spec.rb +165 -0
  104. data/spec/handlers/class_handler_spec.rb +68 -0
  105. data/spec/handlers/class_variable_handler_spec.rb +9 -0
  106. data/spec/handlers/constant_handler_spec.rb +13 -0
  107. data/spec/handlers/examples/alias_handler_001.rb.txt +24 -0
  108. data/spec/handlers/examples/attribute_handler_001.rb.txt +19 -0
  109. data/spec/handlers/examples/class_handler_001.rb.txt +39 -0
  110. data/spec/handlers/examples/class_variable_handler_001.rb.txt +9 -0
  111. data/spec/handlers/examples/constant_handler_001.rb.txt +10 -0
  112. data/spec/handlers/examples/exception_handler_001.rb.txt +42 -0
  113. data/spec/handlers/examples/method_handler_001.rb.txt +35 -0
  114. data/spec/handlers/examples/mixin_handler_001.rb.txt +12 -0
  115. data/spec/handlers/examples/module_handler_001.rb.txt +16 -0
  116. data/spec/handlers/examples/visibility_handler_001.rb.txt +20 -0
  117. data/spec/handlers/examples/yield_handler_001.rb.txt +55 -0
  118. data/spec/handlers/exception_handler_spec.rb +35 -0
  119. data/spec/handlers/method_handler_spec.rb +35 -0
  120. data/spec/handlers/mixin_handler_spec.rb +30 -0
  121. data/spec/handlers/module_handler_spec.rb +25 -0
  122. data/spec/handlers/spec_helper.rb +21 -0
  123. data/spec/handlers/visibility_handler_spec.rb +24 -0
  124. data/spec/handlers/yield_handler_spec.rb +51 -0
  125. data/spec/parser/examples/example1.rb.txt +8 -0
  126. data/spec/parser/examples/tag_handler_001.rb.txt +8 -0
  127. data/spec/parser/source_parser_spec.rb +43 -0
  128. data/spec/parser/tag_parsing_spec.rb +18 -0
  129. data/spec/parser/token_list_spec.rb +35 -0
  130. data/spec/registry_spec.rb +70 -0
  131. data/spec/serializers/file_system_serializer_spec.rb +91 -0
  132. data/spec/serializers/spec_helper.rb +2 -0
  133. data/spec/spec_helper.rb +77 -0
  134. data/templates/default/attributes/html/header.erb +35 -0
  135. data/templates/default/attributes/text/header.erb +10 -0
  136. data/templates/default/class/html/header.erb +4 -0
  137. data/templates/default/constants/html/constants.erb +9 -0
  138. data/templates/default/constants/html/header.erb +3 -0
  139. data/templates/default/constants/html/included.erb +9 -0
  140. data/templates/default/constants/html/inherited.erb +9 -0
  141. data/templates/default/constructor/html/header.erb +10 -0
  142. data/templates/default/deprecated/html/main.erb +4 -0
  143. data/templates/default/deprecated/text/main.erb +3 -0
  144. data/templates/default/docstring/html/main.erb +3 -0
  145. data/templates/default/docstring/text/main.erb +3 -0
  146. data/templates/default/fulldoc/html/all_methods.erb +25 -0
  147. data/templates/default/fulldoc/html/all_namespaces.erb +19 -0
  148. data/templates/default/fulldoc/html/app.js +18 -0
  149. data/templates/default/fulldoc/html/header.erb +15 -0
  150. data/templates/default/fulldoc/html/html_head.erb +3 -0
  151. data/templates/default/fulldoc/html/index.erb +18 -0
  152. data/templates/default/fulldoc/html/jquery.js +11 -0
  153. data/templates/default/fulldoc/html/readme.erb +15 -0
  154. data/templates/default/fulldoc/html/style.css +65 -0
  155. data/templates/default/fulldoc/html/syntax_highlight.css +21 -0
  156. data/templates/default/inheritance/html/header.erb +8 -0
  157. data/templates/default/inheritance/text/header.erb +3 -0
  158. data/templates/default/method/html/aliases.erb +6 -0
  159. data/templates/default/method/html/header.erb +3 -0
  160. data/templates/default/method/html/title.erb +3 -0
  161. data/templates/default/methoddetails/html/header.erb +8 -0
  162. data/templates/default/methoddetails/html/method_header.erb +3 -0
  163. data/templates/default/methodmissing/html/header.erb +12 -0
  164. data/templates/default/methodsignature/html/main.erb +8 -0
  165. data/templates/default/methodsignature/text/main.erb +5 -0
  166. data/templates/default/methodsummary/html/header.erb +5 -0
  167. data/templates/default/methodsummary/html/included.erb +9 -0
  168. data/templates/default/methodsummary/html/inherited.erb +9 -0
  169. data/templates/default/methodsummary/html/summary.erb +25 -0
  170. data/templates/default/methodsummary/text/header.erb +5 -0
  171. data/templates/default/methodsummary/text/included.erb +0 -0
  172. data/templates/default/methodsummary/text/inherited.erb +0 -0
  173. data/templates/default/methodsummary/text/summary.erb +3 -0
  174. data/templates/default/mixins/html/header.erb +4 -0
  175. data/templates/default/module/html/header.erb +4 -0
  176. data/templates/default/quickdoc/html/header.erb +15 -0
  177. data/templates/default/quickdoc/text/header.erb +12 -0
  178. data/templates/default/source/html/main.erb +15 -0
  179. data/templates/default/source/text/main.erb +4 -0
  180. data/templates/default/tags/html/header.erb +4 -0
  181. data/templates/default/tags/html/see.erb +13 -0
  182. data/templates/default/tags/html/tags.erb +20 -0
  183. data/templates/default/tags/text/header.erb +3 -0
  184. data/templates/default/tags/text/see.erb +5 -0
  185. data/templates/default/tags/text/tags.erb +7 -0
  186. data/templates/default/uml/dot/child.erb +1 -0
  187. data/templates/default/uml/dot/dependencies.erb +10 -0
  188. data/templates/default/uml/dot/header.erb +6 -0
  189. data/templates/default/uml/dot/info.erb +14 -0
  190. data/templates/default/uml/dot/subgraph.erb +6 -0
  191. data/templates/default/uml/dot/superclasses.erb +9 -0
  192. data/templates/default/uml/dot/unknown.erb +3 -0
  193. data/templates/default/uml/dot/unknown_child.erb +1 -0
  194. data/templates/default/visibilitygroup/html/header.erb +6 -0
  195. data/templates/javadoc/attributes/html/header.erb +16 -0
  196. data/templates/javadoc/class/html/header.erb +4 -0
  197. data/templates/javadoc/constants/html/constants.erb +9 -0
  198. data/templates/javadoc/constants/html/header.erb +3 -0
  199. data/templates/javadoc/constants/html/included.erb +12 -0
  200. data/templates/javadoc/constants/html/inherited.erb +12 -0
  201. data/templates/javadoc/constructor/html/header.erb +10 -0
  202. data/templates/javadoc/deprecated/html/main.erb +0 -0
  203. data/templates/javadoc/docstring/html/main.erb +6 -0
  204. data/templates/javadoc/fulldoc/html/all_methods.erb +25 -0
  205. data/templates/javadoc/fulldoc/html/all_namespaces.erb +19 -0
  206. data/templates/javadoc/fulldoc/html/app.js +18 -0
  207. data/templates/javadoc/fulldoc/html/header.erb +15 -0
  208. data/templates/javadoc/fulldoc/html/html_head.erb +3 -0
  209. data/templates/javadoc/fulldoc/html/index.erb +18 -0
  210. data/templates/javadoc/fulldoc/html/jquery.js +11 -0
  211. data/templates/javadoc/fulldoc/html/readme.erb +15 -0
  212. data/templates/javadoc/fulldoc/html/style.css +22 -0
  213. data/templates/javadoc/fulldoc/html/syntax_highlight.css +21 -0
  214. data/templates/javadoc/inheritance/html/header.erb +6 -0
  215. data/templates/javadoc/method/html/aliases.erb +6 -0
  216. data/templates/javadoc/method/html/header.erb +4 -0
  217. data/templates/javadoc/method/html/title.erb +4 -0
  218. data/templates/javadoc/methoddetails/html/header.erb +8 -0
  219. data/templates/javadoc/methoddetails/html/method_header.erb +0 -0
  220. data/templates/javadoc/methodmissing/html/header.erb +12 -0
  221. data/templates/javadoc/methodsignature/html/main.erb +8 -0
  222. data/templates/javadoc/methodsummary/html/header.erb +5 -0
  223. data/templates/javadoc/methodsummary/html/included.erb +12 -0
  224. data/templates/javadoc/methodsummary/html/inherited.erb +12 -0
  225. data/templates/javadoc/methodsummary/html/summary.erb +25 -0
  226. data/templates/javadoc/mixins/html/header.erb +5 -0
  227. data/templates/javadoc/module/html/header.erb +4 -0
  228. data/templates/javadoc/source/html/main.erb +15 -0
  229. data/templates/javadoc/tags/html/header.erb +5 -0
  230. data/templates/javadoc/tags/html/see.erb +8 -0
  231. data/templates/javadoc/tags/html/tags.erb +19 -0
  232. data/templates/javadoc/visibilitygroup/html/header.erb +5 -0
  233. metadata +352 -50
  234. data/README.pdf +0 -0
  235. data/lib/code_object.rb +0 -337
  236. data/lib/extra.rb +0 -8
  237. data/lib/formatter.rb +0 -90
  238. data/lib/handlers/all_handlers.rb +0 -2
  239. data/lib/handlers/attribute_handler.rb +0 -51
  240. data/lib/handlers/class_handler.rb +0 -30
  241. data/lib/handlers/class_variable_handler.rb +0 -9
  242. data/lib/handlers/code_object_handler.rb +0 -104
  243. data/lib/handlers/constant_handler.rb +0 -11
  244. data/lib/handlers/exception_handler.rb +0 -20
  245. data/lib/handlers/method_handler.rb +0 -28
  246. data/lib/handlers/mixin_handler.rb +0 -15
  247. data/lib/handlers/module_handler.rb +0 -9
  248. data/lib/handlers/visibility_handler.rb +0 -7
  249. data/lib/handlers/yield_handler.rb +0 -33
  250. data/lib/logger.rb +0 -19
  251. data/lib/namespace.rb +0 -98
  252. data/lib/quick_doc.rb +0 -104
  253. data/lib/ruby_lex.rb +0 -1321
  254. data/lib/source_parser.rb +0 -253
  255. data/lib/tag_library.rb +0 -175
  256. data/lib/tag_type.rb +0 -155
  257. data/templates/default/html/_fulldoc.erb +0 -64
  258. data/templates/default/html/class.erb +0 -226
  259. data/templates/default/html/method.erb +0 -20
  260. data/templates/default/html/module.erb +0 -126
  261. data/test/fixtures/docstring.txt +0 -23
  262. data/test/fixtures/docstring2.txt +0 -4
  263. data/test/test_code_object.rb +0 -66
  264. data/test/test_namespace.rb +0 -10
@@ -1,64 +0,0 @@
1
- <% if tag("deprecated") %>
2
- <p><strong>Deprecated.</strong> <em><%= to_html tag("deprecated").text %></em></p>
3
- <% end %>
4
- <% if tag("yield") %>
5
- <p><strong>Yields Block.</strong> <em><%= to_html tag("yield").text %></em></p>
6
- <% end %>
7
- <p>
8
- <%= to_html docstring %>
9
- </p>
10
- <% unless tags.empty? %>
11
- <dl>
12
- <% unless tags("param").empty? %>
13
- <dt>Parameters:</dt>
14
- <dd>
15
- <% tags("param").each do |tag| %>
16
- <% unless tag.types.empty? %>
17
- [<%= tag.types.collect {|t| "<tt>" + link_to_path(t, parent) + "</tt>" }.join(", ") %>]
18
- <% end %>
19
- <tt><%= tag.name %></tt> <%= "- " + to_html(tag.text) if tag.text %><br />
20
- <% end %>
21
- </dd>
22
- <% end %>
23
- <% unless tags("yieldparam").empty? %>
24
- <dt>Yield Parameters:</dt>
25
- <dd>
26
- <% tags("yieldparam").each do |tag| %>
27
- <% unless tag.types.empty? %>
28
- [<%= tag.types.collect {|t| "<tt>" + link_to_path(t, parent) + "</tt>" }.join(", ") %>]
29
- <% end %>
30
- <tt><%= tag.name %></tt> <%= "- " + to_html(tag.text) if tag.text %><br />
31
- <% end %>
32
- </dd>
33
- <% end %>
34
- <% if has_tag?("return") %>
35
- <dt>Returns:</dt>
36
- <dd><%= to_html tag("return").text %></dd>
37
- <% end %>
38
- <% unless tags("raise").empty? %>
39
- <dt>Raises:</dt>
40
- <dd>
41
- <% tags("raise").each do |tag| %>
42
- <tt><%= link_to_path(tag.name, parent) %></tt> <%= "- " + to_html(tag.text) if tag.text %><br />
43
- <% end %>
44
- </dd>
45
- <% end %>
46
-
47
- <% if has_tag?("author") %>
48
- <dt>Author:</dt>
49
- <dd><%= to_html tag("author").text %></dd>
50
- <% end %>
51
- <% if has_tag?("version") %>
52
- <dt>Version:</dt>
53
- <dd><%= to_html tag("version").text %></dd>
54
- <% end %>
55
- <% if has_tag?("since") %>
56
- <dt>Since:</dt>
57
- <dd><%= to_html tag("since").text %></dd>
58
- <% end %>
59
- <% unless tags("see").empty? %>
60
- <dt>See Also:</dt>
61
- <dd><%= tags("see").collect {|t| "<tt>" + link_to_path(t.text, parent) + "</tt>" }.join(", ") %></dd>
62
- <% end %>
63
- </dl>
64
- <% end %>
@@ -1,226 +0,0 @@
1
- <% _class_methods = class_methods.select {|k,m| m.visibility == :public }.sort %>
2
- <% _instance_methods = instance_methods.select {|k,m| m.visibility == :public && k != 'initialize' && k != 'method_missing' }.sort %>
3
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
9
- <title>Ruby documentation: <%= path %></title>
10
- <style>
11
- .topdoc * dt {
12
- font-weight: bold;
13
- }
14
- .fulldoc {
15
- margin-left: 37px;
16
- }
17
- .fulldoc * dt {
18
- font-weight: bold;
19
- }
20
- h1 { color: #000; }
21
- td { padding: 3px; }
22
- </style>
23
- <base target="_self" />
24
- </head
25
- <body>
26
- <h1>Class <%= path %></h1>
27
- <% unless superclasses.empty? %>
28
- <pre>
29
- <% spaces = 0 -%>
30
- <% superclasses.reverse.each do |superclass| -%><%= (" " * spaces) + (spaces > 0 ? "+--" : "") + link_to_path(superclass) %>
31
- <% spaces += (spaces == 0 ? 2 : 4) -%><%= (" " * spaces) + "|" %>
32
- <% end -%><%= (" " * spaces ) + "+--" + path %>
33
- </pre>
34
- <% end %>
35
-
36
- <% unless mixins.empty? %>
37
- <p>
38
- <strong>All Included Modules:</strong><br />
39
- <%= "&nbsp;" * 7 %><%= mixins.collect {|m| link_to_path(m) }.join(", ") %>
40
- </p>
41
- <% end %>
42
-
43
- <hr />
44
-
45
- <% if docstring %>
46
- <div class="topdoc">
47
- <%= formatter.render('_fulldoc') %>
48
- </div>
49
- <hr />
50
- <% end %>
51
-
52
- <% unless self[:attributes].empty? %>
53
- <h1>Attributes</h1>
54
- <p style="line-height:20px">
55
- <% self[:attributes].sort.each do |name, rw| %>
56
- <tt><%= name %> [<%= [(rw[:read] ? "R" : nil), (rw[:write] ? "W" : nil)].compact.join(", ") %>]</tt><br />
57
- <% end %>
58
- </p>
59
- <% end %>
60
-
61
- <% displayed_constants = false %>
62
- <% unless constants.empty? %>
63
- <h1>Constants</h1><% displayed_constants = true %>
64
- <dl>
65
- <% constants.each do |name, constant| %>
66
- <dt id="const-<%= name %>"><pre><%= constant.full_source.gsub(/\s+/,' ') %></pre></dt>
67
- <dd><%= to_html constant.docstring %></dd>
68
- <% end %>
69
- </dl>
70
- <% end %>
71
-
72
- <% inheritance_tree.each do |name| %>
73
- <% superclass = Namespace.at(name) or next %>
74
- <% unless (consts = superclass.constants).empty? %>
75
- <% unless displayed_constants %><h1>Constants</h1><% end %>
76
- <p><table border="1" width="100%">
77
- <tr background="#ddddff">
78
- <th>Constants <%= superclass.type == :module ? "included" : "inherited" %> from <%= link_to_path(superclass.path) %></th>
79
- </tr>
80
- <tr>
81
- <td><%= consts.collect {|m| "<tt>" + link_to_path(m.first, superclass.path) + "</tt>" }.join(", ") %></td>
82
- </tr>
83
- </table></p>
84
- <% end %>
85
- <% end %>
86
-
87
- <% displayed_cvars = false %>
88
- <% unless class_variables.empty? %>
89
- <h1>Class Variables</h1><% displayed_cvars = true %>
90
- <dl>
91
- <% class_variables.each do |name, cvar| %>
92
- <dt><pre><%= cvar.source.gsub(/\s+/,' ') %></pre></dt>
93
- <dd><%= to_html cvar.docstring %></dd>
94
- <% end %>
95
- </dl>
96
- <% end %>
97
-
98
- <% superclasses.each do |name| %>
99
- <% superclass = Namespace.at(name) or next %>
100
- <% unless (consts = superclass.class_variables.sort).empty? %>
101
- <% unless displayed_cvars %><h1>Constants</h1><% end %>
102
- <p><table border="1" width="100%">
103
- <tr background="#ddddff">
104
- <th>Class Variables inherited from <%= link_to_path(superclass.path) %></th>
105
- </tr>
106
- <tr>
107
- <td><%= consts.reject {|name, cvar| class_variables.has_key? name }.
108
- collect {|name, cvar| "<tt>" + link_to_path(cvar, nil, name) + "</tt>" }.join(", ") %></td>
109
- </tr>
110
- </table></p>
111
- <% end %>
112
- <% end %>
113
-
114
- <% if method = instance_methods['initialize'] %>
115
- <h1>Constructor Summary</h1>
116
- <tt>
117
- <%= method.source.gsub(/\Adef\s+/, '') %>
118
- <% unless method.tags("yieldparam").empty? %>
119
- {|<%= method.tags("yieldparam").collect {|t| t.name }.join(", ") %>| ... }
120
- <% end %>
121
- </tt>
122
- <%= method.to_s(format, template) %>
123
- <% else %>
124
- <% inheritance_tree.each do |name| %>
125
- <% superclass = Namespace.at(name) or next %>
126
- <% if method = superclass.instance_methods['initialize'] %>
127
- <h1>Constructor Summary</h1>
128
- <p>
129
- <em>This class inherits a constructor from <tt><%= link_to_path(method.path, nil, method.parent.path) %></tt></em>
130
- </p>
131
- <% break %>
132
- <% end %>
133
- <% end %>
134
- <% end %>
135
-
136
- <% if method = instance_methods['method_missing'] %>
137
- <h1>Dynamic Method Handling</h1>
138
- <p><em>This class handles dynamic methods through the <tt>method_missing</tt> method</em></p>
139
- <%= method.to_s(format, template) %>
140
- <% else %>
141
- <% inheritance_tree.each do |name| %>
142
- <% superclass = Namespace.at(name) or next %>
143
- <% if method = superclass.instance_methods['method_missing'] %>
144
- <h1>Dynamic Method Handling</h1>
145
- <p>
146
- <em>
147
- This class handles dynamic methods through the
148
- <tt>
149
- <%= link_to_path(method.path, nil, 'method_missing') %></tt> method in
150
- the <%= superclass.type %> <tt><%= link_to_path(superclass.path) %></tt>
151
- </tt>
152
- </em>
153
- </p>
154
- <% break %>
155
- <% end %>
156
- <% end %>
157
- <% end %>
158
-
159
- <% displayed_public_meth_summary = false %>
160
- <% CodeObject::SCOPES.each do |scope| %>
161
- <% unless eval("_#{scope}_methods").empty? %>
162
- <% displayed_public_meth_summary = true %>
163
- <h1>Public <%= scope.to_s.capitalize %> Method Summary</h1>
164
- <table border="1" width="100%">
165
- <% eval("_#{scope}_methods").each do |name, method| %>
166
- <tr>
167
- <td width="70" align="right" valign="top">
168
- <small>
169
- <% if method.tag("return") && method.tag("return").types %>
170
- <%= method.tag("return").types.collect {|t| link_to_path(t) }.join(", ") %>
171
- <% else %>
172
- <%= ClassObject::BASE_OBJECT %>
173
- <% end %>
174
- </small>
175
- </td>
176
- <td>
177
- <tt>
178
- <%= method.source.sub(/\Adef\s+\S+?(\(|\s|;|$)/, link_to_path(method.path, nil, method.name) + '\1') if method.source %>
179
- <% unless method.tags("yieldparam").empty? %>
180
- {|<%= method.tags("yieldparam").collect {|t| t.name }.join(", ") %>| ... }
181
- <% end %>
182
- </tt><br />
183
- <%= ("&nbsp;" * 5) + to_html(method.docstring.sub(/(\.|\n).+/m,'')) + "." if method.docstring && !method.docstring.empty? %>
184
- <% if method.tag("deprecated") %>
185
- <br /><strong>Deprecated.</strong> <em><%= method.tag("deprecated").text %></em>
186
- <% end %>
187
- </td>
188
- </tr>
189
- <% end %>
190
- </table>
191
- <% end %>
192
-
193
- <% inheritance_tree.each do |name| %>
194
- <% superclass = Namespace.at(name) or next %>
195
- <% unless (meths = superclass.send("#{scope}_methods").select {|k,m| m.visibility == :public }).empty? %>
196
- <% unless displayed_public_meth_summary %>
197
- <h1>Public <%= scope.to_s.capitalize %> Method Summary</h1>
198
- <% end %>
199
- <p><table border="1" width="100%">
200
- <tr background="#ddddff">
201
- <th>
202
- Public <%= scope %> methods <%= superclass.type == :module ? "included" : "inherited" %>
203
- from <%= link_to_path(superclass.path) %>
204
- </th>
205
- </tr>
206
- <tr>
207
- <td><%= superclass.send("#{scope}_methods").reject {|name, m| meths.include? name }.
208
- collect {|name, m| "<tt>" + link_to_path(superclass.path + (scope == :instance ? "#" : "::") +
209
- name, nil, name) + "</tt>" }.join(", ") %></td>
210
- </tr>
211
- </table></p>
212
- <% end %>
213
- <% end %>
214
- <% end %>
215
-
216
- <% CodeObject::SCOPES.each do |scope| %>
217
- <% unless eval("_#{scope}_methods").empty? %>
218
- <h1>Public <%= scope.to_s.capitalize %> Method Details</h1>
219
- <% eval("_#{scope}_methods").each do |name, method| %>
220
- <%= method.to_s(format, template) %>
221
- <hr />
222
- <% end %>
223
- <% end %>
224
- <% end %>
225
- </body>
226
- </html>
@@ -1,20 +0,0 @@
1
- <div id="<%= scope %>_method-<%= name %>">
2
- <h3><%= name %></h3>
3
- <%
4
- if tag("return") && !tag("return").types.empty?
5
- type = tag("return").types.collect {|t| link_to_path(t, parent) }.join(", ")
6
- type = "[#{type}]" if tag("return").types.size > 1
7
- else
8
- type = ClassObject::BASE_OBJECT
9
- end
10
- %>
11
- <tt>
12
- <%= source.gsub(/\Adef/, "#{visibility} " + type) if source %>
13
- <% unless tags("yieldparam").empty? %>
14
- {|<%= tags("yieldparam").map {|t| t.name }.join(", ") %>| ... }
15
- <% end %>
16
- </tt>
17
- <div class="fulldoc">
18
- <%= formatter.render('_fulldoc') %>
19
- </div>
20
- </div>
@@ -1,126 +0,0 @@
1
- <% _class_methods = class_methods.select {|k,m| m.visibility == :public }.sort %>
2
- <% _instance_methods = instance_methods.select {|k,m| m.visibility == :public && k != 'initialize' && k != 'method_missing' }.sort %>
3
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
9
- <title>Ruby documentation: <%= path %></title>
10
- <style>
11
- .topdoc * dt {
12
- font-weight: bold;
13
- }
14
- .fulldoc {
15
- margin-left: 37px;
16
- }
17
- .fulldoc * dt {
18
- font-weight: bold;
19
- }
20
- h1 { color: #000; }
21
- td { padding: 3px; }
22
- </style>
23
- <base target="_self" />
24
- </head>
25
- <body>
26
- <h1>Module <%= path %></h1>
27
-
28
- <% if mixins && !mixins.empty? %>
29
- <p>
30
- <strong>All Included Modules:</strong><br />
31
- <%= "&nbsp;" * 7 %><%= mixins.collect {|m| link_to_path(m) }.join(", ") %>
32
- </p>
33
- <% end %>
34
-
35
- <hr />
36
-
37
- <% if docstring %>
38
- <div class="topdoc">
39
- <%= formatter.render('_fulldoc') %>
40
- </div>
41
- <hr />
42
- <% end %>
43
-
44
- <% if self[:attributes] && !self[:attributes].empty? %>
45
- <h1>Attributes</h1>
46
- <p style="line-height:20px">
47
- <% self[:attributes].sort.each do |name, rw| %>
48
- <tt><%= name %> [<%= [(rw[:read] ? "R" : nil), (rw[:write] ? "W" : nil)].compact.join(", ") %>]</tt><br />
49
- <% end %>
50
- </p>
51
- <% end %>
52
-
53
- <% displayed_constants = false %>
54
- <% if constants && !constants.empty? %>
55
- <h1>Constants</h1><% displayed_constants = true %>
56
- <dl>
57
- <% constants.each do |name, constant| %>
58
- <dt id="const-<%= name %>"><pre><%= constant.full_source.gsub(/\s+/,' ') %></pre></dt>
59
- <dd><%= to_html constant.docstring %></dd>
60
- <% end %>
61
- </dl>
62
- <% end %>
63
-
64
- <% if method = instance_methods['initialize'] %>
65
- <h1>Constructor Summary</h1>
66
- <tt>
67
- <%= method.source.gsub(/\Adef\s+/, '') %>
68
- <% unless method.tags("yieldparam").empty? %>
69
- {|<%= method.tags("yieldparam").collect {|t| t.name }.join(", ") %>| ... }
70
- <% end %>
71
- </tt>
72
- <%= method.to_s(format, template) %>
73
- <% end %>
74
-
75
- <% if method = instance_methods['method_missing'] %>
76
- <h1>Dynamic Method Handling</h1>
77
- <p><em>This class handles dynamic methods through the <tt>method_missing</tt> method</em></p>
78
- <%= method.to_s(format, template) %>
79
- <% end %>
80
-
81
- <% displayed_public_meth_summary = false %>
82
- <% CodeObject::SCOPES.each do |scope| %>
83
- <% unless eval("_#{scope}_methods").empty? %>
84
- <% displayed_public_meth_summary = true %>
85
- <h1>Public <%= scope.to_s.capitalize %> Method Summary</h1>
86
- <table border="1" width="100%">
87
- <% eval("_#{scope}_methods").each do |name, method| %>
88
- <tr>
89
- <td width="70" align="right" valign="top">
90
- <small>
91
- <% if method.tag("return") && method.tag("return").types %>
92
- <%= method.tag("return").types.collect {|t| link_to_path(t) }.join(", ") %>
93
- <% else %>
94
- <%= ClassObject::BASE_OBJECT %>
95
- <% end %>
96
- </small>
97
- </td>
98
- <td>
99
- <tt>
100
- <%= method.source.sub(/\Adef\s+\S+?(\(|\s|;|$)/, link_to_path(method.path, nil, method.name) + '\1') if method.source %>
101
- <% unless method.tags("yieldparam").empty? %>
102
- {|<%= method.tags("yieldparam").collect {|t| t.name }.join(", ") %>| ... }
103
- <% end %>
104
- </tt><br />
105
- <%= ("&nbsp;" * 5) + to_html(method.docstring.sub(/(\.|\n).+/m,'')) + "." if method.docstring && !method.docstring.empty? %>
106
- <% if method.tag("deprecated") %>
107
- <br /><strong>Deprecated.</strong> <em><%= method.tag("deprecated").text %></em>
108
- <% end %>
109
- </td>
110
- </tr>
111
- <% end %>
112
- </table>
113
- <% end %>
114
- <% end %>
115
-
116
- <% CodeObject::SCOPES.each do |scope| %>
117
- <% unless eval("_#{scope}_methods").empty? %>
118
- <h1>Public <%= scope.to_s.capitalize %> Method Details</h1>
119
- <% eval("_#{scope}_methods").each do |name, method| %>
120
- <%= method.to_s(format, template) %>
121
- <hr />
122
- <% end %>
123
- <% end %>
124
- <% end %>
125
- </body>
126
- </html>
@@ -1,23 +0,0 @@
1
-
2
-
3
- = Introduction
4
-
5
- This is a sample docstring for testing purposes
6
-
7
- It includes most of the RDoc syntax, though
8
-
9
- @param normal a normal parameter with no type
10
-
11
- * It shouldn't matter
12
- * What the RDoc data is
13
-
14
- Finally:: It also contains meta data tags:
15
-
16
- @raise IOError an ioerror if things go wrong
17
- @author Loren Segal
18
- @deprecated
19
- @param [String] obj the first object in the list
20
- @param [String, Array<String>] obj2
21
- @return [Object] it really will
22
- return anything
23
- it wants.