yard 0.2.3.5 → 0.4.0

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 (365) hide show
  1. data/.yardopts +12 -10
  2. data/ChangeLog +5686 -0
  3. data/{README.markdown → README.md} +65 -11
  4. data/Rakefile +25 -13
  5. data/benchmarks/concat_vs_join.rb +12 -0
  6. data/benchmarks/erb_vs_erubis.rb +14 -14
  7. data/benchmarks/marshal_vs_dbm.rb +1 -1
  8. data/benchmarks/pathname_vs_string.rb +50 -0
  9. data/benchmarks/template_erb.rb +22 -0
  10. data/benchmarks/template_format.rb +6 -0
  11. data/benchmarks/template_profile.rb +17 -0
  12. data/bin/yri +16 -7
  13. data/docs/{CODE_OBJECTS.markdown → CodeObjects.md} +0 -0
  14. data/docs/{GETTING_STARTED.markdown → GettingStarted.md} +49 -11
  15. data/docs/{GLOSSARY.markdown → Glossary.md} +0 -0
  16. data/docs/{HANDLERS.markdown → Handlers.md} +5 -5
  17. data/docs/{OVERVIEW.markdown → Overview.md} +9 -13
  18. data/docs/{PARSER.markdown → Parser.md} +1 -1
  19. data/docs/{TAGS.markdown → Tags.md} +1 -1
  20. data/docs/Templates.md +286 -0
  21. data/docs/{WHATSNEW.markdown → WhatsNew.md} +82 -2
  22. data/lib/rubygems_plugin.rb +17 -20
  23. data/lib/yard.rb +47 -1
  24. data/lib/yard/autoload.rb +38 -47
  25. data/lib/yard/cli/yard_graph.rb +36 -13
  26. data/lib/yard/cli/yardoc.rb +74 -12
  27. data/lib/yard/code_objects/base.rb +182 -14
  28. data/lib/yard/code_objects/class_object.rb +39 -2
  29. data/lib/yard/code_objects/class_variable_object.rb +4 -0
  30. data/lib/yard/code_objects/constant_object.rb +8 -0
  31. data/lib/yard/code_objects/extended_method_object.rb +14 -0
  32. data/lib/yard/code_objects/method_object.rb +60 -2
  33. data/lib/yard/code_objects/module_object.rb +6 -0
  34. data/lib/yard/code_objects/namespace_object.rb +99 -2
  35. data/lib/yard/code_objects/proxy.rb +53 -6
  36. data/lib/yard/code_objects/root_object.rb +2 -0
  37. data/lib/yard/core_ext/array.rb +61 -0
  38. data/lib/yard/core_ext/file.rb +21 -4
  39. data/lib/yard/core_ext/module.rb +11 -1
  40. data/lib/yard/core_ext/string.rb +13 -2
  41. data/lib/yard/core_ext/symbol_hash.rb +51 -3
  42. data/lib/yard/docstring.rb +68 -19
  43. data/lib/yard/globals.rb +5 -2
  44. data/lib/yard/handlers/base.rb +13 -3
  45. data/lib/yard/handlers/processor.rb +64 -2
  46. data/lib/yard/handlers/ruby/class_handler.rb +1 -1
  47. data/lib/yard/handlers/ruby/class_variable_handler.rb +5 -1
  48. data/lib/yard/handlers/ruby/constant_handler.rb +38 -4
  49. data/lib/yard/handlers/ruby/exception_handler.rb +1 -0
  50. data/lib/yard/handlers/ruby/legacy/base.rb +2 -2
  51. data/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +6 -3
  52. data/lib/yard/handlers/ruby/legacy/constant_handler.rb +21 -2
  53. data/lib/yard/handlers/ruby/legacy/method_handler.rb +10 -0
  54. data/lib/yard/handlers/ruby/legacy/yield_handler.rb +2 -1
  55. data/lib/yard/handlers/ruby/method_handler.rb +10 -0
  56. data/lib/yard/handlers/ruby/yield_handler.rb +2 -1
  57. data/lib/yard/logging.rb +17 -0
  58. data/lib/yard/parser/ruby/ast_node.rb +101 -0
  59. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +2 -2
  60. data/lib/yard/parser/ruby/legacy/statement_list.rb +10 -9
  61. data/lib/yard/parser/ruby/ruby_parser.rb +32 -3
  62. data/lib/yard/parser/source_parser.rb +82 -5
  63. data/lib/yard/rake/yardoc_task.rb +38 -3
  64. data/lib/yard/registry.rb +112 -2
  65. data/lib/yard/serializers/base.rb +48 -1
  66. data/lib/yard/serializers/file_system_serializer.rb +23 -2
  67. data/lib/yard/serializers/process_serializer.rb +10 -0
  68. data/lib/yard/serializers/stdout_serializer.rb +11 -0
  69. data/lib/yard/tags/library.rb +4 -1
  70. data/lib/yard/tags/overload_tag.rb +3 -12
  71. data/lib/yard/templates/engine.rb +162 -0
  72. data/lib/yard/{generators → templates}/helpers/base_helper.rb +14 -13
  73. data/lib/yard/{generators → templates}/helpers/filter_helper.rb +1 -1
  74. data/lib/yard/templates/helpers/html_helper.rb +287 -0
  75. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +29 -0
  76. data/lib/yard/templates/helpers/html_syntax_highlight_helper18.rb +27 -0
  77. data/lib/yard/{generators → templates}/helpers/markup_helper.rb +15 -11
  78. data/lib/yard/{generators → templates}/helpers/method_helper.rb +8 -1
  79. data/lib/yard/templates/helpers/module_helper.rb +15 -0
  80. data/lib/yard/templates/helpers/text_helper.rb +60 -0
  81. data/lib/yard/templates/helpers/uml_helper.rb +33 -0
  82. data/lib/yard/templates/template.rb +355 -0
  83. data/lib/yard/verifier.rb +110 -0
  84. data/spec/cli/yardoc_spec.rb +23 -1
  85. data/spec/code_objects/base_spec.rb +8 -0
  86. data/spec/code_objects/class_object_spec.rb +166 -156
  87. data/spec/code_objects/method_object_spec.rb +2 -2
  88. data/spec/code_objects/module_object_spec.rb +112 -110
  89. data/spec/code_objects/proxy_spec.rb +9 -0
  90. data/spec/core_ext/array_spec.rb +33 -0
  91. data/spec/core_ext/file_spec.rb +40 -12
  92. data/spec/core_ext/module_spec.rb +15 -0
  93. data/spec/core_ext/string_spec.rb +10 -2
  94. data/spec/docstring_spec.rb +157 -135
  95. data/spec/handlers/class_handler_spec.rb +3 -0
  96. data/spec/handlers/class_variable_handler_spec.rb +3 -1
  97. data/spec/handlers/constant_handler_spec.rb +38 -0
  98. data/spec/handlers/examples/class_handler_001.rb.txt +14 -1
  99. data/spec/handlers/examples/class_variable_handler_001.rb.txt +1 -0
  100. data/spec/handlers/examples/constant_handler_001.rb.txt +10 -1
  101. data/spec/handlers/examples/exception_handler_001.rb.txt +5 -0
  102. data/spec/handlers/examples/method_handler_001.rb.txt +15 -0
  103. data/spec/handlers/examples/mixin_handler_001.rb.txt +13 -0
  104. data/spec/handlers/exception_handler_spec.rb +4 -0
  105. data/spec/handlers/method_handler_spec.rb +22 -0
  106. data/spec/handlers/mixin_handler_spec.rb +5 -3
  107. data/spec/handlers/yield_handler_spec.rb +1 -1
  108. data/spec/parser/ruby/ast_node_spec.rb +16 -0
  109. data/spec/parser/ruby/legacy/statement_list_spec.rb +36 -0
  110. data/spec/parser/ruby/ruby_parser_spec.rb +80 -0
  111. data/spec/parser/source_parser_spec.rb +48 -2
  112. data/spec/rake/yardoc_task_spec.rb +62 -25
  113. data/spec/serializers/file_system_serializer_spec.rb +1 -1
  114. data/spec/templates/class_spec.rb +34 -0
  115. data/spec/templates/engine_spec.rb +121 -0
  116. data/spec/templates/examples/class001.html +271 -0
  117. data/spec/templates/examples/class001.txt +31 -0
  118. data/spec/templates/examples/method001.html +96 -0
  119. data/spec/templates/examples/method001.txt +28 -0
  120. data/spec/templates/examples/method002.html +81 -0
  121. data/spec/templates/examples/method002.txt +20 -0
  122. data/spec/templates/examples/method003.html +137 -0
  123. data/spec/templates/examples/method003.txt +45 -0
  124. data/spec/templates/examples/module001.dot +31 -0
  125. data/spec/templates/examples/module001.html +294 -0
  126. data/spec/templates/examples/module001.txt +33 -0
  127. data/spec/templates/examples/tag001.txt +82 -0
  128. data/spec/templates/helpers/base_helper_spec.rb +129 -0
  129. data/spec/{generators → templates}/helpers/html_helper_spec.rb +73 -16
  130. data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +39 -0
  131. data/spec/{generators → templates}/helpers/markup_helper_spec.rb +6 -7
  132. data/spec/templates/method_spec.rb +75 -0
  133. data/spec/templates/module_spec.rb +50 -0
  134. data/spec/templates/spec_helper.rb +33 -0
  135. data/spec/templates/tag_spec.rb +39 -0
  136. data/spec/templates/template_spec.rb +398 -0
  137. data/spec/verifier_spec.rb +51 -0
  138. data/spec/yard_spec.rb +46 -0
  139. data/templates/default/class/dot/setup.rb +6 -0
  140. data/templates/default/class/dot/superklass.erb +3 -0
  141. data/templates/default/class/html/constructor_details.erb +8 -0
  142. data/templates/default/class/html/setup.rb +1 -0
  143. data/templates/default/class/html/subclasses.erb +4 -0
  144. data/templates/default/class/setup.rb +29 -0
  145. data/templates/default/class/text/setup.rb +11 -0
  146. data/templates/default/class/text/subclasses.erb +5 -0
  147. data/templates/default/docstring/html/abstract.erb +4 -0
  148. data/templates/default/docstring/html/deprecated.erb +1 -0
  149. data/templates/default/docstring/html/index.erb +5 -0
  150. data/templates/default/docstring/html/note.erb +6 -0
  151. data/templates/default/docstring/html/text.erb +1 -0
  152. data/templates/default/docstring/html/todo.erb +6 -0
  153. data/templates/default/docstring/setup.rb +39 -0
  154. data/templates/default/docstring/text/abstract.erb +2 -0
  155. data/templates/default/docstring/text/deprecated.erb +2 -0
  156. data/templates/default/docstring/text/index.erb +2 -0
  157. data/templates/default/docstring/text/note.erb +4 -0
  158. data/templates/default/docstring/text/text.erb +1 -0
  159. data/templates/default/docstring/text/todo.erb +4 -0
  160. data/templates/default/fulldoc/html/css/common.css +1 -0
  161. data/templates/default/fulldoc/html/css/full_list.css +23 -0
  162. data/templates/default/fulldoc/html/css/style.css +261 -0
  163. data/templates/default/fulldoc/html/full_list.erb +36 -0
  164. data/templates/default/fulldoc/html/js/app.js +91 -0
  165. data/templates/default/fulldoc/html/js/full_list.js +39 -0
  166. data/templates/default/fulldoc/html/js/jquery.js +19 -0
  167. data/templates/default/fulldoc/html/setup.rb +86 -0
  168. data/templates/default/{uml → layout}/dot/header.erb +2 -2
  169. data/templates/default/layout/dot/setup.rb +14 -0
  170. data/templates/default/layout/html/breadcrumb.erb +11 -0
  171. data/templates/default/layout/html/footer.erb +5 -0
  172. data/templates/default/layout/html/headers.erb +13 -0
  173. data/templates/default/layout/html/index.erb +49 -0
  174. data/templates/default/layout/html/layout.erb +20 -0
  175. data/templates/default/layout/html/search.erb +5 -0
  176. data/templates/default/layout/html/setup.rb +58 -0
  177. data/templates/default/method/html/header.erb +14 -3
  178. data/templates/default/method/setup.rb +3 -0
  179. data/templates/default/method/text/header.erb +1 -1
  180. data/templates/default/method_details/html/header.erb +3 -0
  181. data/templates/default/method_details/html/method_signature.erb +17 -0
  182. data/templates/default/method_details/html/source.erb +10 -0
  183. data/templates/default/method_details/setup.rb +8 -0
  184. data/templates/default/method_details/text/header.erb +10 -0
  185. data/templates/default/method_details/text/method_signature.erb +12 -0
  186. data/templates/default/method_details/text/setup.rb +10 -0
  187. data/templates/default/module/dot/child.erb +1 -0
  188. data/templates/default/module/dot/dependencies.erb +3 -0
  189. data/templates/default/{uml/dot/subgraph.erb → module/dot/header.erb} +3 -3
  190. data/templates/default/{uml → module}/dot/info.erb +4 -4
  191. data/templates/default/module/dot/setup.rb +14 -0
  192. data/templates/default/module/html/attribute_details.erb +11 -0
  193. data/templates/default/module/html/attribute_summary.erb +8 -0
  194. data/templates/default/module/html/box_info.erb +32 -0
  195. data/templates/default/module/html/children.erb +8 -0
  196. data/templates/default/module/html/constant_summary.erb +13 -0
  197. data/templates/default/module/html/defines.erb +3 -0
  198. data/templates/default/module/html/header.erb +4 -4
  199. data/templates/default/module/html/inherited_constants.erb +8 -0
  200. data/templates/default/module/html/inherited_methods.erb +9 -0
  201. data/templates/default/module/html/item_summary.erb +20 -0
  202. data/templates/default/module/html/method_details_list.erb +8 -0
  203. data/templates/default/module/html/method_summary.erb +8 -0
  204. data/templates/default/module/html/methodmissing.erb +12 -0
  205. data/templates/default/module/html/pre_docstring.erb +1 -0
  206. data/templates/default/module/setup.rb +83 -0
  207. data/templates/default/module/text/children.erb +10 -0
  208. data/templates/default/module/text/class_meths_list.erb +8 -0
  209. data/templates/default/module/text/extends.erb +8 -0
  210. data/templates/default/module/text/header.erb +7 -0
  211. data/templates/default/module/text/includes.erb +8 -0
  212. data/templates/default/module/text/instance_meths_list.erb +8 -0
  213. data/templates/default/module/text/setup.rb +12 -0
  214. data/templates/default/root/dot/child.erb +3 -0
  215. data/templates/default/root/dot/setup.rb +5 -0
  216. data/templates/default/tags/html/example.erb +5 -16
  217. data/templates/default/tags/html/index.erb +3 -0
  218. data/templates/default/tags/html/option.erb +17 -20
  219. data/templates/default/tags/html/overload.erb +13 -0
  220. data/templates/default/tags/html/see.erb +5 -10
  221. data/templates/default/tags/html/tag.erb +20 -0
  222. data/templates/default/tags/setup.rb +50 -0
  223. data/templates/default/tags/text/example.erb +8 -10
  224. data/templates/default/tags/text/index.erb +1 -0
  225. data/templates/default/tags/text/option.erb +18 -3
  226. data/templates/default/tags/text/overload.erb +19 -0
  227. data/templates/default/tags/text/see.erb +8 -2
  228. data/templates/default/tags/text/tag.erb +13 -0
  229. metadata +142 -158
  230. data/bin/view_generator +0 -17
  231. data/docs/FAQ.markdown +0 -34
  232. data/docs/GENERATORS.markdown +0 -211
  233. data/lib/yard/generators/attributes_generator.rb +0 -22
  234. data/lib/yard/generators/base.rb +0 -305
  235. data/lib/yard/generators/class_generator.rb +0 -27
  236. data/lib/yard/generators/constants_generator.rb +0 -74
  237. data/lib/yard/generators/constructor_generator.rb +0 -25
  238. data/lib/yard/generators/deprecated_generator.rb +0 -15
  239. data/lib/yard/generators/docstring_generator.rb +0 -15
  240. data/lib/yard/generators/full_doc_generator.rb +0 -127
  241. data/lib/yard/generators/helpers/html_helper.rb +0 -196
  242. data/lib/yard/generators/helpers/html_syntax_highlight_helper.rb +0 -49
  243. data/lib/yard/generators/helpers/uml_helper.rb +0 -16
  244. data/lib/yard/generators/inheritance_generator.rb +0 -16
  245. data/lib/yard/generators/method_details_generator.rb +0 -18
  246. data/lib/yard/generators/method_generator.rb +0 -43
  247. data/lib/yard/generators/method_listing_generator.rb +0 -105
  248. data/lib/yard/generators/method_missing_generator.rb +0 -25
  249. data/lib/yard/generators/method_signature_generator.rb +0 -19
  250. data/lib/yard/generators/method_summary_generator.rb +0 -21
  251. data/lib/yard/generators/mixins_generator.rb +0 -21
  252. data/lib/yard/generators/module_generator.rb +0 -23
  253. data/lib/yard/generators/overloads_generator.rb +0 -20
  254. data/lib/yard/generators/quick_doc_generator.rb +0 -25
  255. data/lib/yard/generators/root_generator.rb +0 -32
  256. data/lib/yard/generators/source_generator.rb +0 -11
  257. data/lib/yard/generators/tags_generator.rb +0 -99
  258. data/lib/yard/generators/uml_generator.rb +0 -102
  259. data/lib/yard/generators/visibility_group_generator.rb +0 -26
  260. data/spec/generators/base_spec.rb +0 -64
  261. data/spec/generators/full_doc_generator_spec.rb +0 -29
  262. data/spec/generators/helpers/base_helper_spec.rb +0 -15
  263. data/spec/generators/quick_doc_generator_spec.rb +0 -13
  264. data/templates/default/attributes/html/header.erb +0 -47
  265. data/templates/default/attributes/text/header.erb +0 -10
  266. data/templates/default/class/html/header.erb +0 -4
  267. data/templates/default/constants/html/constants.erb +0 -9
  268. data/templates/default/constants/html/header.erb +0 -3
  269. data/templates/default/constants/html/included.erb +0 -9
  270. data/templates/default/constants/html/inherited.erb +0 -9
  271. data/templates/default/constructor/html/header.erb +0 -10
  272. data/templates/default/deprecated/html/main.erb +0 -6
  273. data/templates/default/deprecated/text/main.erb +0 -3
  274. data/templates/default/docstring/html/main.erb +0 -3
  275. data/templates/default/docstring/text/main.erb +0 -3
  276. data/templates/default/fulldoc/html/all_files.erb +0 -19
  277. data/templates/default/fulldoc/html/all_methods.erb +0 -26
  278. data/templates/default/fulldoc/html/all_namespaces.erb +0 -22
  279. data/templates/default/fulldoc/html/app.js +0 -18
  280. data/templates/default/fulldoc/html/custom.css +0 -1
  281. data/templates/default/fulldoc/html/file.erb +0 -16
  282. data/templates/default/fulldoc/html/footer.erb +0 -5
  283. data/templates/default/fulldoc/html/header.erb +0 -16
  284. data/templates/default/fulldoc/html/html_head.erb +0 -4
  285. data/templates/default/fulldoc/html/index.erb +0 -19
  286. data/templates/default/fulldoc/html/jquery.js +0 -11
  287. data/templates/default/fulldoc/html/style.css +0 -81
  288. data/templates/default/fulldoc/html/syntax_highlight.css +0 -24
  289. data/templates/default/inheritance/html/header.erb +0 -8
  290. data/templates/default/inheritance/text/header.erb +0 -3
  291. data/templates/default/method/html/aliases.erb +0 -6
  292. data/templates/default/method/html/title.erb +0 -3
  293. data/templates/default/method/text/title.erb +0 -1
  294. data/templates/default/methoddetails/html/header.erb +0 -8
  295. data/templates/default/methoddetails/html/method_header.erb +0 -3
  296. data/templates/default/methodmissing/html/header.erb +0 -12
  297. data/templates/default/methodsignature/html/main.erb +0 -10
  298. data/templates/default/methodsignature/text/main.erb +0 -8
  299. data/templates/default/methodsummary/html/header.erb +0 -5
  300. data/templates/default/methodsummary/html/included.erb +0 -9
  301. data/templates/default/methodsummary/html/inherited.erb +0 -9
  302. data/templates/default/methodsummary/html/summary.erb +0 -29
  303. data/templates/default/methodsummary/text/header.erb +0 -5
  304. data/templates/default/methodsummary/text/included.erb +0 -0
  305. data/templates/default/methodsummary/text/inherited.erb +0 -0
  306. data/templates/default/methodsummary/text/summary.erb +0 -6
  307. data/templates/default/mixins/html/header.erb +0 -4
  308. data/templates/default/overloads/html/header.erb +0 -8
  309. data/templates/default/overloads/text/header.erb +0 -8
  310. data/templates/default/quickdoc/html/header.erb +0 -15
  311. data/templates/default/quickdoc/text/header.erb +0 -12
  312. data/templates/default/root/html/header.erb +0 -4
  313. data/templates/default/source/html/main.erb +0 -15
  314. data/templates/default/source/text/main.erb +0 -4
  315. data/templates/default/tags/html/header.erb +0 -4
  316. data/templates/default/tags/html/param.erb +0 -21
  317. data/templates/default/tags/html/tags.erb +0 -23
  318. data/templates/default/tags/html/todo.erb +0 -8
  319. data/templates/default/tags/text/header.erb +0 -3
  320. data/templates/default/tags/text/param.erb +0 -9
  321. data/templates/default/tags/text/tags.erb +0 -7
  322. data/templates/default/uml/dot/child.erb +0 -1
  323. data/templates/default/uml/dot/dependencies.erb +0 -10
  324. data/templates/default/uml/dot/superclasses.erb +0 -9
  325. data/templates/default/uml/dot/unknown.erb +0 -3
  326. data/templates/default/uml/dot/unknown_child.erb +0 -1
  327. data/templates/default/visibilitygroup/html/header.erb +0 -6
  328. data/templates/javadoc/attributes/html/header.erb +0 -16
  329. data/templates/javadoc/class/html/header.erb +0 -4
  330. data/templates/javadoc/constants/html/constants.erb +0 -9
  331. data/templates/javadoc/constants/html/header.erb +0 -3
  332. data/templates/javadoc/constants/html/included.erb +0 -12
  333. data/templates/javadoc/constants/html/inherited.erb +0 -12
  334. data/templates/javadoc/constructor/html/header.erb +0 -10
  335. data/templates/javadoc/deprecated/html/main.erb +0 -0
  336. data/templates/javadoc/docstring/html/main.erb +0 -6
  337. data/templates/javadoc/fulldoc/html/all_methods.erb +0 -25
  338. data/templates/javadoc/fulldoc/html/all_namespaces.erb +0 -19
  339. data/templates/javadoc/fulldoc/html/app.js +0 -18
  340. data/templates/javadoc/fulldoc/html/header.erb +0 -15
  341. data/templates/javadoc/fulldoc/html/html_head.erb +0 -3
  342. data/templates/javadoc/fulldoc/html/index.erb +0 -18
  343. data/templates/javadoc/fulldoc/html/jquery.js +0 -11
  344. data/templates/javadoc/fulldoc/html/readme.erb +0 -15
  345. data/templates/javadoc/fulldoc/html/style.css +0 -22
  346. data/templates/javadoc/fulldoc/html/syntax_highlight.css +0 -21
  347. data/templates/javadoc/inheritance/html/header.erb +0 -6
  348. data/templates/javadoc/method/html/aliases.erb +0 -6
  349. data/templates/javadoc/method/html/header.erb +0 -4
  350. data/templates/javadoc/method/html/title.erb +0 -4
  351. data/templates/javadoc/methoddetails/html/header.erb +0 -8
  352. data/templates/javadoc/methoddetails/html/method_header.erb +0 -0
  353. data/templates/javadoc/methodmissing/html/header.erb +0 -12
  354. data/templates/javadoc/methodsignature/html/main.erb +0 -8
  355. data/templates/javadoc/methodsummary/html/header.erb +0 -5
  356. data/templates/javadoc/methodsummary/html/included.erb +0 -12
  357. data/templates/javadoc/methodsummary/html/inherited.erb +0 -12
  358. data/templates/javadoc/methodsummary/html/summary.erb +0 -25
  359. data/templates/javadoc/mixins/html/header.erb +0 -5
  360. data/templates/javadoc/module/html/header.erb +0 -4
  361. data/templates/javadoc/source/html/main.erb +0 -15
  362. data/templates/javadoc/tags/html/header.erb +0 -5
  363. data/templates/javadoc/tags/html/see.erb +0 -8
  364. data/templates/javadoc/tags/html/tags.erb +0 -19
  365. data/templates/javadoc/visibilitygroup/html/header.erb +0 -5
@@ -1,5 +1,5 @@
1
- YARD Release 0.2.3.4 (August 7th 2009)
2
- =====================================
1
+ YARD Release 0.4.0 "The Whole Nine" (Nov 15th 2009)
2
+ ===================================================
3
3
 
4
4
  **Homepage**: [http://yard.rubyforge.org](http://yard.rubyforge.org)
5
5
  **IRC**: **Join us on IRC in #yard on irc.freenode.net!**
@@ -35,7 +35,7 @@ important information about objects, such as what parameters they take and what
35
35
  they are expected to be, what type a
method should return, what exceptions it can
36
36
  raise, if it is deprecated, etc.. It also allows information to be better (and more
37
37
  consistently) organized
during the output generation phase. You can find a list
38
- of tags in the {file:GETTING_STARTED.markdown#taglist GETTING_STARTED.markdown} file.
38
+ of tags in the {file:GettingStarted.md#taglist GettingStarted.md} file.
39
39
 
40
40
  YARD also supports an optional "types" declarations for certain tags.

41
41
  This allows the developer to document type signatures for ruby methods and

@@ -121,19 +121,52 @@ option to speed up the generation process by skipping source parsing.
121
121
 
122
122
  YARD will by default only document code in your public visibility. You can
123
123
  document your protected and private code by adding `--protected` or
124
- `--private` to the option switches.
124
+ `--private` to the option switches. In addition, you can add `--no-private`
125
+ to also ignore any object that has the `@private` meta-tag. This is similar
126
+ to RDoc's ":nodoc:" behaviour, though the distinction is important. RDoc
127
+ implies that the object with :nodoc: would not be documented, whereas
128
+ YARD still recommends documenting private objects for the private API (for
129
+ maintainer/developer consumption).
125
130
 
126
- You can also add extra informative files with the `--files` switch,
127
- for example:
131
+ You can also add extra informative files (README, LICENSE) by separating
132
+ the globs and the filenames with '-'.
128
133
 
129
- $ yardoc --files FAQ,LICENSE
134
+ $ yardoc 'app/**/*.rb' - README LICENSE FAQ
135
+
136
+ If no globs preceed the '-' argument, the default glob (lib/**/*.rb) is
137
+ used:
130
138
 
131
- Note that the README file is specified with its own `--readme` switch.
139
+ $ yardoc - README LICENSE FAQ
140
+
141
+ Note that the README file can be specified with its own `--readme` switch.
132
142
 
133
143
  You can also add a `.yardopts` file to your project directory which lists
134
144
  the switches separated by whitespace (newlines or space) to pass to yardoc
135
145
  whenever it is run.
136
146
 
147
+ <h4>Queries</h4>
148
+
149
+ The `yardoc` tool also supports a `--query` argument to only include objects
150
+ that match a certain data or meta-data query. The query syntax is Ruby, though
151
+ a few shortcuts are available. For instance, to document only objects that have
152
+ an "@api" tag with the value "public", all of the following syntaxes would give
153
+ the same result:
154
+
155
+ --query '@api.text == "public"'
156
+ --query 'object.has_tag?(:api) && object.tag(:api).text == "public"'
157
+ --query 'has_tag?(:api) && tag(:api).text == "public"'
158
+
159
+ Note that the "@tag" syntax returns the first tag named "tag" on the object.
160
+ To return the array of all tags named "tag", use "@@tag".
161
+
162
+ Multiple `--query` arguments are allowed in the command line parameters. The
163
+ following two lines both check for the existence of a return and param tag:
164
+
165
+ --query '@return' --query '@param'
166
+ --query '@rturn && @param'
167
+
168
+ For more information about the query syntax, see the {YARD::Verifier} class.
169
+
137
170
  **2. Rake Task**
138
171
 
139
172
  The second most obvious is to generate docs via a Rake task. You can do this by
@@ -150,7 +183,7 @@ to add. Again, a full list of options is available by typing `yardoc --help`
150
183
  in a shell. You can also override the options at the Rake command-line with the
151
184
  OPTS environment variable:
152
185
 
153
- $ rake yardoc OPTS='--any --extra --opts'
186
+ $ rake yard OPTS='--any --extra --opts'
154
187
 
155
188
  **3. `yri` RI Implementation**
156
189
 
@@ -159,7 +192,10 @@ access to your documentation. It's way faster than ri but currently does not
159
192
  work with the stdlib or core Ruby libraries, only the active project. Example:
160
193
 
161
194
  $ yri YARD::Handlers::Base#register
162
- $ yri File::relative_path
195
+ $ yri File.relative_path
196
+
197
+ Note that class methods must not be referred to with the "::" namespace
198
+ separator. Only modules, classes and constants should use "::".
163
199
 
164
200
  **4. `yard-graph` Graphviz Generator**
165
201
 
@@ -178,6 +214,24 @@ More options can be seen by typing `yard-graph --help`, but here is an example:
178
214
  CHANGELOG
179
215
  ---------
180
216
 
217
+ - **November.15.09**: 0.4.0 release
218
+ - Added new templating engine based on [tadpole](http://github.com/lsegal/tadpole)
219
+ - Added YARD queries (`--query` CLI argument to yardoc)
220
+ - Greatly expanded YARD documentation
221
+ - Added plugin support
222
+ - New `@abstract` and `@private` tags
223
+ - Changed default rake task to `rake yard`
224
+ - Read about changes in {file:WhatsNew.md}
225
+
226
+ - **August.13.09**: 0.2.3.5 release
227
+ - Minor bug fixes.
228
+
229
+ - **August.07.09**: 0.2.3.4 release
230
+ - Minor bug fixes.
231
+
232
+ - **July.26.09**: 0.2.3.3 release
233
+ - Minor bug fixes.
234
+
181
235
  - **July.06.09**: 0.2.3.2 release
182
236
  - Fix Textile hard-break issues
183
237
  - Add description for @see tag to use as link title in HTML docs.
@@ -196,7 +250,7 @@ CHANGELOG
196
250
  RDoc. To take advantage of this plugin, set `has_rdoc = 'yard'` in your
197
251
  .gemspec file.
198
252
 
199
- - **Jun.07.09**: 0.2.3 release. See the {file:WHATSNEW.markdown} file for a
253
+ - **Jun.07.09**: 0.2.3 release. See the {file:WhatsNew.md} file for a
200
254
  list of important new features.
201
255
 
202
256
  - **Jun.16.08**: 0.2.2 release. This is the largest changset since yard's
data/Rakefile CHANGED
@@ -1,8 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/lib/yard'
2
2
  require 'rubygems'
3
3
  require 'rake/gempackagetask'
4
- require 'spec'
5
- require 'spec/rake/spectask'
6
4
 
7
5
  WINDOWS = (PLATFORM =~ /win32|cygwin/ ? true : false) rescue false
8
6
  SUDO = WINDOWS ? '' : 'sudo'
@@ -17,22 +15,36 @@ Rake::GemPackageTask.new(SPEC) do |pkg|
17
15
  end
18
16
 
19
17
  desc "Install the gem locally"
20
- task :install => :package do
21
- sh "#{SUDO} gem install pkg/#{SPEC.name}-#{SPEC.version}.gem --local"
18
+ task :install => :gem do
19
+ sh "#{SUDO} gem install pkg/#{SPEC.name}-#{SPEC.version}.gem --local --no-rdoc --no-ri"
22
20
  sh "rm -rf pkg/yard-#{SPEC.version}" unless ENV['KEEP_FILES']
23
21
  end
24
22
 
25
- desc "Run all specs"
26
- Spec::Rake::SpecTask.new("specs") do |t|
27
- $DEBUG = true if ENV['DEBUG']
28
- t.spec_opts = ["--format", "specdoc", "--colour"]
29
- t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
30
- t.spec_files = Dir["spec/**/*_spec.rb"].sort
31
- t.rcov = true if ENV['RCOV']
32
- t.rcov_opts = ['-x', '_spec\.rb$,spec_helper\.rb$']
23
+ begin
24
+ require 'spec'
25
+ require 'spec/rake/spectask'
26
+
27
+ desc "Run all specs"
28
+ Spec::Rake::SpecTask.new("specs") do |t|
29
+ $DEBUG = true if ENV['DEBUG']
30
+ t.spec_opts = ["--format", "specdoc", "--colour"]
31
+ t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
32
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
33
+
34
+ if ENV['RCOV']
35
+ hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
36
+ hide += ',legacy\/.+_handler,html_syntax_highlight_helper18\.rb$' if RUBY19
37
+ hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$,html_syntax_highlight_helper\.rb$' if RUBY18
38
+ t.rcov = true
39
+ t.rcov_opts = ['-x', hide]
40
+ end
41
+ end
42
+ task :spec => :specs
43
+ rescue LoadError
44
+ warn "warn: RSpec tests not available. `gem install rspec` to enable them."
33
45
  end
34
- task :spec => :specs
35
46
 
36
47
  YARD::Rake::YardocTask.new do |t|
48
+ t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
37
49
  t.after = lambda { `cp -R docs/images/ doc/images/` }
38
50
  end
@@ -0,0 +1,12 @@
1
+ require "benchmark"
2
+
3
+ STR1 = "Hello"
4
+ JOIN = "::"
5
+ STR2 = "World"
6
+
7
+ TESTS = 100_000
8
+ Benchmark.bmbm do |results|
9
+ results.report("concat") { TESTS.times { "".concat(STR1).concat(JOIN).concat(STR2) } }
10
+ results.report("add ") { TESTS.times { STR1 + JOIN + STR2 } }
11
+ results.report("join ") { TESTS.times { [STR1, STR2].join(JOIN) } }
12
+ end
@@ -6,16 +6,16 @@ require "benchmark"
6
6
  require File.join(File.dirname(__FILE__), '..', 'lib', 'yard')
7
7
 
8
8
  def rungen
9
- YARD::Registry.clear
10
- YARD::CLI::Yardoc.run('--quiet', '--use-cache')
9
+ YARD::Registry.load_yardoc(File.join(File.dirname(__FILE__), '..', '.yardoc'))
10
+ YARD::Registry.at("YARD::CodeObjects::Base").format(:format => :html)
11
11
  end
12
12
 
13
13
  Benchmark.bmbm do |x|
14
14
  x.report("erubis") do
15
15
  eval <<-eof
16
- class YARD::Generators::Base
17
- def erb(str) Erubis::Eruby.new(str) end
18
- end
16
+ module YARD; module Templates; module Template
17
+ def erb_with(str, x) Erubis::Eruby.new(str) end
18
+ end end end
19
19
  eof
20
20
 
21
21
  rungen
@@ -23,9 +23,9 @@ Benchmark.bmbm do |x|
23
23
 
24
24
  x.report("fast-erubis") do
25
25
  eval <<-eof
26
- class YARD::Generators::Base
27
- def erb(str) Erubis::FastEruby.new(str) end
28
- end
26
+ module YARD; module Templates; module Template
27
+ def erb_with(str, x) Erubis::FastEruby.new(str) end
28
+ end end end
29
29
  eof
30
30
 
31
31
  rungen
@@ -33,9 +33,9 @@ Benchmark.bmbm do |x|
33
33
 
34
34
  x.report("tiny-erubis") do
35
35
  eval <<-eof
36
- class YARD::Generators::Base
37
- def erb(str) Erubis::TinyEruby.new(str) end
38
- end
36
+ module YARD; module Templates; module Template
37
+ def erb_with(str, x) Erubis::TinyEruby.new(str) end
38
+ end end end
39
39
  eof
40
40
 
41
41
  rungen
@@ -43,9 +43,9 @@ Benchmark.bmbm do |x|
43
43
 
44
44
  x.report("erb") do
45
45
  eval <<-eof
46
- class YARD::Generators::Base
47
- def erb(str) ERB.new(str, nil, '<>') end
48
- end
46
+ module YARD; module Templates; module Template
47
+ def erb_with(str, x) ERB.new(str, nil) end
48
+ end end end
49
49
  eof
50
50
 
51
51
  rungen
@@ -29,7 +29,7 @@ def write_marshal
29
29
  File.unlink(MARSHAL_FILE) if File.exist?(MARSHAL_FILE)
30
30
  handle = {}
31
31
  NUM_INDICES.times {|t| handle[t.to_s] = generate_index }
32
- File.open(MARSHAL_FILE, "w") {|f| f.write(Marshal.dump(handle)) }
32
+ File.open(MARSHAL_FILE, "wb") {|f| f.write(Marshal.dump(handle)) }
33
33
  end
34
34
 
35
35
  def read_marshal
@@ -0,0 +1,50 @@
1
+ require 'pathname'
2
+ require "benchmark"
3
+ require File.dirname(__FILE__) + '/../lib/yard'
4
+
5
+ pathobj = Pathname.new("a/b/c")
6
+ strobj = "a/b/c"
7
+
8
+ TIMES = 1_000
9
+
10
+ puts "join:"
11
+ Benchmark.bmbm do |x|
12
+ x.report("pathname") { TIMES.times { Pathname.new("a/b/c").join("d", "e", "f") } }
13
+ x.report("string ") { TIMES.times { File.join("a/b/c", "d", "e", "f") } }
14
+ x.report("pathname-sameobject") { TIMES.times { pathobj.join("d", "e", "f") } }
15
+ x.report("string-sameobject ") { TIMES.times { File.join(strobj, "d", "e", "f") } }
16
+ end
17
+
18
+ puts
19
+ puts
20
+ puts "cleanpath:"
21
+ Benchmark.bmbm do |x|
22
+ x.report("pathname") { TIMES.times { Pathname.new("a/b//.././c").cleanpath } }
23
+ x.report("string ") { TIMES.times { File.cleanpath("a/b//.././c") } }
24
+ end
25
+
26
+ __END__
27
+ join:
28
+ Rehearsal -------------------------------------------------------
29
+ pathname 0.330000 0.020000 0.350000 ( 0.353481)
30
+ string 0.010000 0.000000 0.010000 ( 0.001390)
31
+ pathname-sameobject 0.360000 0.020000 0.380000 ( 0.384473)
32
+ string-sameobject 0.000000 0.000000 0.000000 ( 0.001187)
33
+ ---------------------------------------------- total: 0.740000sec
34
+
35
+ user system total real
36
+ pathname 0.330000 0.020000 0.350000 ( 0.350820)
37
+ string 0.000000 0.000000 0.000000 ( 0.001055)
38
+ pathname-sameobject 0.330000 0.010000 0.340000 ( 0.346949)
39
+ string-sameobject 0.000000 0.000000 0.000000 ( 0.001141)
40
+
41
+
42
+ cleanpath:
43
+ Rehearsal --------------------------------------------
44
+ pathname 0.060000 0.000000 0.060000 ( 0.059767)
45
+ string 0.010000 0.000000 0.010000 ( 0.013775)
46
+ ----------------------------------- total: 0.070000sec
47
+
48
+ user system total real
49
+ pathname 0.060000 0.000000 0.060000 ( 0.059697)
50
+ string 0.020000 0.000000 0.020000 ( 0.013624)
@@ -0,0 +1,22 @@
1
+ require "benchmark"
2
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'yard')
3
+
4
+ YARD::Registry.load_yardoc(File.join(File.dirname(__FILE__), '..', '.yardoc'))
5
+ obj = YARD::Registry.at("YARD::CodeObjects::Base")
6
+
7
+ TIMES = 3
8
+ Benchmark.bm do |x|
9
+ x.report("trim-line") { TIMES.times { obj.format(:format => :html) } }
10
+ module YARD
11
+ module Templates
12
+ module Template
13
+ def erb(section, &block)
14
+ erb = ERB.new(cache(section), nil)
15
+ erb.filename = cache_filename(section).to_s
16
+ erb.result(binding, &block)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ x.report("no-trim ") { TIMES.times { obj.format(:format => :html) } }
22
+ end
@@ -0,0 +1,6 @@
1
+ require "benchmark"
2
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'yard')
3
+
4
+ YARD::Registry.load_yardoc(File.join(File.dirname(__FILE__), '..', '.yardoc'))
5
+ obj = YARD::Registry.at("YARD::CodeObjects::Base")
6
+ puts Benchmark.measure { obj.format(:format => :html) }
@@ -0,0 +1,17 @@
1
+ require 'rubygems'
2
+ require 'ruby-prof'
3
+ #require 'benchmark'
4
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'yard')
5
+
6
+ YARD::Registry.load_yardoc(File.join(File.dirname(__FILE__), '..', '.yardoc'))
7
+ obj = YARD::Registry.at("YARD::CodeObjects::Base")
8
+
9
+ #PerfTools::CpuProfiler.start("template_profile") do
10
+ #end
11
+
12
+ result = RubyProf.profile do
13
+ obj.format(:format => :html, :no_highlight => true)
14
+ end
15
+
16
+ printer = RubyProf::CallTreePrinter.new(result)
17
+ printer.print(STDOUT)
data/bin/yri CHANGED
@@ -10,11 +10,20 @@ else
10
10
  output = YARD::Serializers::ProcessSerializer.new('less')
11
11
  end
12
12
 
13
- object = YARD::Registry.at(ARGV[0])
14
- options = {
15
- :format => :text,
16
- :template => :default,
17
- :serializer => output
18
- }
13
+ if ARGV[0].nil? || ARGV[0].empty?
14
+ puts "Missing object argument"
15
+ exit(1)
16
+ end
17
+
18
+ obj = YARD::Registry.at(ARGV[0])
19
+ if obj.nil?
20
+ puts "No documentation for #{ARGV[0]}"
21
+ exit(1)
22
+ end
19
23
 
20
- YARD::Generators::QuickDocGenerator.new(options).generate(object)
24
+ if obj.type == :method && obj.is_alias?
25
+ tmp = P(obj.namespace, (obj.scope == :instance ? "#" : "") +
26
+ obj.namespace.aliases[obj].to_s)
27
+ obj = tmp unless YARD::CodeObjects::Proxy === tmp
28
+ end
29
+ obj.format(:serializer => output)
@@ -8,6 +8,7 @@ document will cover the most common ways to use YARD:
8
8
  * [Using YARD to Generate Documentation](#using)
9
9
  * [Extending YARD](#extending)
10
10
  * [Templating YARD](#templating)
11
+ * [Plugin Support](#plugins)
11
12
 
12
13
  <a name="docing"></a>
13
14
  Documenting Code with YARD
@@ -32,10 +33,10 @@ and easier to read. Consider the RDoc documentation for a method reverse:
32
33
  #
33
34
  # == Returns:
34
35
  # A string representing the object in a specified
35
- #
36
36
  # format.
37
+ #
37
38
  def to_format(format = :html)
38
- # reverse the string
39
+ # format the object
39
40
  end
40
41
 
41
42
  While this may seem easy enough to read and understand, it's hard for a machine
@@ -51,6 +52,7 @@ In YARD, we would simply define our method as:
51
52
  # @param [Symbol] format the format type, `:text` or `:html`
52
53
  # @return [String] the object converted into the expected format.
53
54
  def to_format(format = :html)
55
+ # format the object
54
56
  end
55
57
 
56
58
  Using tags we can add semantic metadata to our code without worrying about
@@ -114,6 +116,11 @@ List of Tags
114
116
 
115
117
  A list of common tags and example usage is below:
116
118
 
119
+ * `@abstract`: Marks a class/module/method as abstract with optional
120
+ implementor information.
121
+
122
+ @abstract Subclass and override {#run} to implement a custom Threadable class.
123
+
117
124
  * `@author`: List the author(s) of a class/method
118
125
 
119
126
  @author Full Name
@@ -161,6 +168,15 @@ A list of common tags and example usage is below:
161
168
  * `@param`: Defines method parameters
162
169
 
163
170
  @param [optional, types, ...] argname description
171
+
172
+ * `@private`: Defines an object as private. This exists for classes,
173
+ modules and constants that do not obey Ruby's visibility rules. For
174
+ instance, an inner class might be considered "private", though Ruby
175
+ would make no such distinction. By declaring the @private tag, the
176
+ class can be hidden from documentation by using the `--no-private`
177
+ command-line switch to yardoc (see {file:README.md}).
178
+
179
+ @private
164
180
 
165
181
  * `@raise`: Describes an Exception that a method may throw
166
182
 
@@ -213,7 +229,7 @@ Other Extended Syntax
213
229
  To minimize rewriting of documentation and to ease maintenance, a special
214
230
  tag syntax is allowed to reference tags from other objects. Doing this allows
215
231
  a tag to be added as meta-data for multiple objects. A full example of this
216
- syntax is found in the {file:TAGS.markdown#reftags TAGS.markdown} file.
232
+ syntax is found in the {file:Tags.md#reftags Tags} file.
217
233
 
218
234
  **Inter-Document Links**
219
235
 
@@ -233,7 +249,7 @@ documentation to HTML document files. In addition to this, YARD ships with
233
249
  two more tools allowing you to quickly view `ri`-style documentation for
234
250
  a specific class or method as well as an extra tool to generate UML diagrams
235
251
  for your code using [Graphviz][graphviz]. An overview of these tools can
236
- be found in the {file:README.markdown README} under the Usage section.
252
+ be found in the {file:README.md README} under the Usage section.
237
253
 
238
254
  <a name="extending"></a>
239
255
  Extending YARD
@@ -242,22 +258,44 @@ Extending YARD
242
258
  There are many ways to extend YARD to support non-standard Ruby syntax (DSLs),
243
259
  add new meta-data tags or programmatically access the intermediate metadata
244
260
  and documentation from code. An overview of YARD's full architecture can be
245
- found in the {file:OVERVIEW.markdown} document.
261
+ found in the {file:Overview.md} document.
246
262
 
247
- For information on adding support for Ruby DSLs, see the {file:HANDLERS.markdown}
248
- and {file:PARSER.markdown} architecture documents.
263
+ For information on adding support for Ruby DSLs, see the {file:Handlers.md}
264
+ and {file:Parser.md} architecture documents.
249
265
 
250
- For information on adding extra tags, see {file:TAGS.markdown}.
266
+ For information on adding extra tags, see {file:Tags.md}.
251
267
 
252
268
  For information on accessing the data YARD stores about your documentation,
253
- look at the {file:CODE_OBJECTS.markdown} architecture document.
269
+ look at the {file:CodeObjects.md} architecture document.
254
270
 
255
271
  <a name="templating"></a>
256
272
  Templating YARD
257
273
  ===============
258
274
 
259
275
  In many cases you may want to change the style of YARD's templates or add extra
260
- information after extending it. The {file:GENERATORS.markdown} architecture
276
+ information after extending it. The {file:Templates.md} architecture
261
277
  document covers the basics of how YARD's templating system works.
262
278
 
263
- [graphviz]:http://www.graphviz.org
279
+ <a name="plugins"></a>
280
+ Plugin Support
281
+ ==============
282
+
283
+ As of 0.4, YARD will automatically load any gem named with the prefix of
284
+ `yard-` or `yard_`. You can use this to load a custom plugin that
285
+ [extend](#extending) YARD's functionality. A good example of this
286
+ is the [yard-rspec][yard-rspec] plugin, which adds [RSpec][rspec] specifications
287
+ to your documentation (`yardoc` and `yri`). You can try it out by installing
288
+ the gem or cloning the project and trying the example:
289
+
290
+ $ gem install yard-rspec -s http://gemcutter.org
291
+ or
292
+ $ git clone git://github.com/lsegal/yard-spec-plugin
293
+
294
+ YARD also provides a way to temporarily disable plugins on a per-user basis.
295
+ To disable a plugin create the file `~/.yard/ignored_plugins` with a list
296
+ of plugin names separated by newlines. Note that the `.yard` directory might
297
+ not exist, so you may need to create it.
298
+
299
+ [graphviz]:http://www.graphviz.org
300
+ [yard-rspec]:http://github.com/lsegal/yard-spec-plugin
301
+ [rspec]:http://rspec.info