yard 0.9.29 → 0.9.30

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 (152) hide show
  1. checksums.yaml +4 -4
  2. data/docs/CodeObjects.md +115 -0
  3. data/docs/GettingStarted.md +679 -0
  4. data/docs/Handlers.md +152 -0
  5. data/docs/Overview.md +61 -0
  6. data/docs/Parser.md +191 -0
  7. data/docs/Tags.md +283 -0
  8. data/docs/TagsArch.md +123 -0
  9. data/docs/Templates.md +496 -0
  10. data/docs/WhatsNew.md +1245 -0
  11. data/docs/images/code-objects-class-diagram.png +0 -0
  12. data/docs/images/handlers-class-diagram.png +0 -0
  13. data/docs/images/overview-class-diagram.png +0 -0
  14. data/docs/images/parser-class-diagram.png +0 -0
  15. data/docs/images/tags-class-diagram.png +0 -0
  16. data/docs/templates/default/fulldoc/html/full_list_tag.erb +9 -0
  17. data/docs/templates/default/fulldoc/html/setup.rb +6 -0
  18. data/docs/templates/default/layout/html/setup.rb +9 -0
  19. data/docs/templates/default/layout/html/tag_list.erb +11 -0
  20. data/docs/templates/default/yard_tags/html/list.erb +18 -0
  21. data/docs/templates/default/yard_tags/html/setup.rb +26 -0
  22. data/docs/templates/plugin.rb +70 -0
  23. data/lib/yard/version.rb +1 -1
  24. data/po/ja.po +31108 -0
  25. data/templates/default/class/dot/setup.rb +7 -0
  26. data/templates/default/class/dot/superklass.erb +3 -0
  27. data/templates/default/class/html/constructor_details.erb +8 -0
  28. data/templates/default/class/html/setup.rb +2 -0
  29. data/templates/default/class/html/subclasses.erb +4 -0
  30. data/templates/default/class/setup.rb +36 -0
  31. data/templates/default/class/text/setup.rb +12 -0
  32. data/templates/default/class/text/subclasses.erb +5 -0
  33. data/templates/default/constant/text/header.erb +11 -0
  34. data/templates/default/constant/text/setup.rb +4 -0
  35. data/templates/default/docstring/html/abstract.erb +4 -0
  36. data/templates/default/docstring/html/deprecated.erb +1 -0
  37. data/templates/default/docstring/html/index.erb +5 -0
  38. data/templates/default/docstring/html/note.erb +6 -0
  39. data/templates/default/docstring/html/private.erb +4 -0
  40. data/templates/default/docstring/html/returns_void.erb +1 -0
  41. data/templates/default/docstring/html/text.erb +1 -0
  42. data/templates/default/docstring/html/todo.erb +6 -0
  43. data/templates/default/docstring/setup.rb +52 -0
  44. data/templates/default/docstring/text/abstract.erb +2 -0
  45. data/templates/default/docstring/text/deprecated.erb +2 -0
  46. data/templates/default/docstring/text/index.erb +2 -0
  47. data/templates/default/docstring/text/note.erb +4 -0
  48. data/templates/default/docstring/text/private.erb +2 -0
  49. data/templates/default/docstring/text/returns_void.erb +1 -0
  50. data/templates/default/docstring/text/text.erb +1 -0
  51. data/templates/default/docstring/text/todo.erb +4 -0
  52. data/templates/default/fulldoc/html/css/common.css +1 -0
  53. data/templates/default/fulldoc/html/css/full_list.css +58 -0
  54. data/templates/default/fulldoc/html/css/style.css +497 -0
  55. data/templates/default/fulldoc/html/frames.erb +17 -0
  56. data/templates/default/fulldoc/html/full_list.erb +37 -0
  57. data/templates/default/fulldoc/html/full_list_class.erb +2 -0
  58. data/templates/default/fulldoc/html/full_list_file.erb +7 -0
  59. data/templates/default/fulldoc/html/full_list_method.erb +10 -0
  60. data/templates/default/fulldoc/html/js/app.js +314 -0
  61. data/templates/default/fulldoc/html/js/full_list.js +216 -0
  62. data/templates/default/fulldoc/html/js/jquery.js +4 -0
  63. data/templates/default/fulldoc/html/setup.rb +241 -0
  64. data/templates/default/layout/dot/header.erb +6 -0
  65. data/templates/default/layout/dot/setup.rb +15 -0
  66. data/templates/default/layout/html/breadcrumb.erb +11 -0
  67. data/templates/default/layout/html/files.erb +11 -0
  68. data/templates/default/layout/html/footer.erb +5 -0
  69. data/templates/default/layout/html/headers.erb +15 -0
  70. data/templates/default/layout/html/index.erb +2 -0
  71. data/templates/default/layout/html/layout.erb +24 -0
  72. data/templates/default/layout/html/listing.erb +4 -0
  73. data/templates/default/layout/html/objects.erb +32 -0
  74. data/templates/default/layout/html/script_setup.erb +4 -0
  75. data/templates/default/layout/html/search.erb +13 -0
  76. data/templates/default/layout/html/setup.rb +89 -0
  77. data/templates/default/method/html/header.erb +17 -0
  78. data/templates/default/method/setup.rb +4 -0
  79. data/templates/default/method/text/header.erb +1 -0
  80. data/templates/default/method_details/html/header.erb +3 -0
  81. data/templates/default/method_details/html/method_signature.erb +25 -0
  82. data/templates/default/method_details/html/source.erb +10 -0
  83. data/templates/default/method_details/setup.rb +11 -0
  84. data/templates/default/method_details/text/header.erb +10 -0
  85. data/templates/default/method_details/text/method_signature.erb +12 -0
  86. data/templates/default/method_details/text/setup.rb +11 -0
  87. data/templates/default/module/dot/child.erb +1 -0
  88. data/templates/default/module/dot/dependencies.erb +3 -0
  89. data/templates/default/module/dot/header.erb +6 -0
  90. data/templates/default/module/dot/info.erb +14 -0
  91. data/templates/default/module/dot/setup.rb +15 -0
  92. data/templates/default/module/html/attribute_details.erb +10 -0
  93. data/templates/default/module/html/attribute_summary.erb +8 -0
  94. data/templates/default/module/html/box_info.erb +43 -0
  95. data/templates/default/module/html/children.erb +8 -0
  96. data/templates/default/module/html/constant_summary.erb +17 -0
  97. data/templates/default/module/html/defines.erb +3 -0
  98. data/templates/default/module/html/header.erb +5 -0
  99. data/templates/default/module/html/inherited_attributes.erb +14 -0
  100. data/templates/default/module/html/inherited_constants.erb +8 -0
  101. data/templates/default/module/html/inherited_methods.erb +19 -0
  102. data/templates/default/module/html/item_summary.erb +40 -0
  103. data/templates/default/module/html/method_details_list.erb +9 -0
  104. data/templates/default/module/html/method_summary.erb +14 -0
  105. data/templates/default/module/html/methodmissing.erb +12 -0
  106. data/templates/default/module/html/pre_docstring.erb +1 -0
  107. data/templates/default/module/setup.rb +167 -0
  108. data/templates/default/module/text/children.erb +10 -0
  109. data/templates/default/module/text/class_meths_list.erb +8 -0
  110. data/templates/default/module/text/extends.erb +8 -0
  111. data/templates/default/module/text/header.erb +7 -0
  112. data/templates/default/module/text/includes.erb +8 -0
  113. data/templates/default/module/text/instance_meths_list.erb +8 -0
  114. data/templates/default/module/text/setup.rb +13 -0
  115. data/templates/default/onefile/html/files.erb +5 -0
  116. data/templates/default/onefile/html/headers.erb +6 -0
  117. data/templates/default/onefile/html/layout.erb +17 -0
  118. data/templates/default/onefile/html/readme.erb +3 -0
  119. data/templates/default/onefile/html/setup.rb +62 -0
  120. data/templates/default/root/dot/child.erb +3 -0
  121. data/templates/default/root/dot/setup.rb +6 -0
  122. data/templates/default/root/html/setup.rb +2 -0
  123. data/templates/default/tags/html/example.erb +11 -0
  124. data/templates/default/tags/html/index.erb +3 -0
  125. data/templates/default/tags/html/option.erb +24 -0
  126. data/templates/default/tags/html/overload.erb +14 -0
  127. data/templates/default/tags/html/see.erb +8 -0
  128. data/templates/default/tags/html/tag.erb +20 -0
  129. data/templates/default/tags/setup.rb +57 -0
  130. data/templates/default/tags/text/example.erb +12 -0
  131. data/templates/default/tags/text/index.erb +1 -0
  132. data/templates/default/tags/text/option.erb +20 -0
  133. data/templates/default/tags/text/overload.erb +19 -0
  134. data/templates/default/tags/text/see.erb +11 -0
  135. data/templates/default/tags/text/tag.erb +13 -0
  136. data/templates/guide/class/html/setup.rb +2 -0
  137. data/templates/guide/docstring/html/setup.rb +2 -0
  138. data/templates/guide/fulldoc/html/css/style.css +108 -0
  139. data/templates/guide/fulldoc/html/js/app.js +33 -0
  140. data/templates/guide/fulldoc/html/setup.rb +74 -0
  141. data/templates/guide/layout/html/layout.erb +81 -0
  142. data/templates/guide/layout/html/setup.rb +25 -0
  143. data/templates/guide/method/html/header.erb +18 -0
  144. data/templates/guide/method/html/setup.rb +22 -0
  145. data/templates/guide/module/html/header.erb +7 -0
  146. data/templates/guide/module/html/method_list.erb +5 -0
  147. data/templates/guide/module/html/setup.rb +27 -0
  148. data/templates/guide/onefile/html/files.erb +4 -0
  149. data/templates/guide/onefile/html/setup.rb +6 -0
  150. data/templates/guide/onefile/html/toc.erb +3 -0
  151. data/templates/guide/tags/html/setup.rb +9 -0
  152. metadata +151 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93d48bef3450842c6170694239357d0748b8db9318df37d7cefbcb7d988f46d8
4
- data.tar.gz: 93f395f5fdde5e0ecea8c495a79a924cdf358bcdbd75e042a014a21f3985004e
3
+ metadata.gz: 021c7da620d7d0f9e325578d006aaad1a1875de4e8576b40c5f31743d3eb6acf
4
+ data.tar.gz: efc16a043c80228b5930fa4926ff169b2e37851b93b978664fc33b3badb9b3ca
5
5
  SHA512:
6
- metadata.gz: 9eba5a49a6479e64a37fc19dbbc71249c2a493a6d61685c27930d938c6917b02076d5f8aa3fd2d56f1a2deb3fd7ca6f8be6da9cf9abd4ff5bb7e5ee2f420fbdd
7
- data.tar.gz: 414b657d30ed57f3c7d53a77a1a7c89fdc11eff1effcb9c1f17da5c9efe6bc486bf363aa43b0a9970a012c79d6cbe1a28eac855387ede7780100d0218ec82fb0
6
+ metadata.gz: 2df308de968686b9330b893962e34e06cb4fd8f5171c6bd43a21c2ede8691a432df56d1a8ab5f15d600a624ec7b8807542447ebb79952caceb5d24936188a84f
7
+ data.tar.gz: 8106bcbef9ddc3623845825101f58f7014fa13134e78b6382e5e439664031216083ce0a1346d29c763e966eb588d3251073f7e137e81c984c1dc1730d243e147
@@ -0,0 +1,115 @@
1
+ # @title CodeObjects Architecture
2
+
3
+ # CodeObjects Architecture
4
+
5
+ Code objects are Ruby objects that describe the code being documented. For instance,
6
+ all classes, modules, methods, etc. are all extracted from the Ruby source as code
7
+ objects. All of these code objects extend from the {YARD::CodeObjects::Base} class, which
8
+ provides basic attributes like source location, source code, name and path.
9
+
10
+ ## CodeObjects Organization
11
+
12
+ Code objects are divided into two basic types. {YARD::CodeObjects::NamespaceObject NamespaceObjects}
13
+ and non-namespace objects. A namespace object refers to any object in Ruby that can have
14
+ other objects defined inside of it. In the context of Ruby, this specifically means
15
+ modules and classes (both of which are subclasses of `NamespaceObject`). These objects
16
+ act like tree structures, maintaining a list of all of their direct children. All non
17
+ namespace objects are simply subclasses of the Base class. The {YARD::CodeObjects::RootObject RootObject}
18
+ is a special kind of `NamespaceObject` which refers to the top level namespace in Ruby.
19
+ Methods that accept a namespace object as a parameter should also accept the symbol
20
+ `:root` as a shortcut for the root object.
21
+
22
+ The following is an overview of the classes within the `CodeObjects` namespace:
23
+
24
+ ![CodeObjects Class Diagram](images/code-objects-class-diagram.png)
25
+
26
+ ## Unique Path Representation
27
+
28
+ All CodeObjects are uniquely defined by their implementation of {YARD::CodeObjects::Base#path}.
29
+ This path is used to locate or store a code object in the {YARD::Registry}. It is therefore
30
+ essential that any Base subclass return a unique String value for #path so that the
31
+ object may co-exist with other objects in the Registry.
32
+
33
+ In practice, a path is simply the conventional Ruby representation of a class,
34
+ module, constant, class variable or method. For example, the following objects
35
+ would have the following respective paths:
36
+
37
+ * Class `Klass` inside module `Mod`: `Mod::Klass`
38
+ * Instance method `bar` inside class `Foo`: `Foo#bar`
39
+ * Class method `bar` inside class `Foo`: `Foo.bar`
40
+ * Constant `VERSION` inside class `YARD`: `YARD::VERSION`
41
+ * Class variable `@@abc` inside class `A`: `A::@@abc`
42
+
43
+ ## Registry
44
+
45
+ CodeObjects classes are coupled with the {YARD::Registry} class which keeps track of
46
+ all instantiated code objects. This is an explicit design choice to allow objects
47
+ to be fetched, cached, imported and exported from a centralized location. As mentioned
48
+ above, this coupling is a result of the fact that each object is uniquely identified by
49
+ its path, which is used to implement lookups. You can read more about the registry
50
+ in the {YARD::Registry} class.
51
+
52
+ ## Identity Map
53
+
54
+ Code objects are instantiated using an identity-map like implementation that guarantees
55
+ only one unique Ruby object exists for an object described by a specific path. This
56
+ allows developers to create a code object without checking if it already exists in
57
+ the {YARD::Registry}. The following example will only create one object:
58
+
59
+ id = ClassObject.new(:root, "MyClass").object_id #=> 13352
60
+ ClassObject.new(:root, "MyClass").object_id #=> 13352
61
+
62
+ ## Proxy Objects
63
+
64
+ In addition to providing access to existing objects, a {YARD::CodeObjects::Proxy}
65
+ class exists which can represent an object at a path that may or may not have been
66
+ created. This is necessary to represent a reference to an object in code that is
67
+ never defined in the same body of source code, or perhaps defined later. If any
68
+ attributes of a proxy are accessed, it will immediately be resolved to the object
69
+ at its declared path. In the case where such an object exists, it will act as
70
+ a delegate to the object. However, if the object does not exist, a warning will
71
+ be raised. Whenever arbitrary code objects are used, care should be taken in
72
+ order to make sure attributes are not accessed on unresolvable proxies. An
73
+ unresolvable proxy will return a class name of `Proxy` and #type of `:proxy`,
74
+ for example:
75
+
76
+ P(:InvalidObject).type == :proxy #=> true
77
+ P(:InvalidObject).is_a?(Proxy) #=> true
78
+
79
+ ## Adding Data to Code Objects
80
+
81
+ Code objects act as hash-like structures that allow any arbitrary value to be set.
82
+ This allows easy extending of existing objects without creating custom subclasses.
83
+ For instance, to add a timestamp to a method object (when it was modified, maybe),
84
+ it is possible to simply do:
85
+
86
+ object = MethodObject.new(:root, "my_method")
87
+ object[:modified_at] = Time.now
88
+
89
+ This value can now be retrieved on this object both by the hash `[]` syntax as
90
+ well as like any other method:
91
+
92
+ object.modified_at #=> 2009-06-03 20:08:46 -0400
93
+
94
+ ## Creating a Custom CodeObject
95
+
96
+ It should first be mentioned that creating a custom code object should not be
97
+ necessary in most cases, except when functionality that cannot be represented
98
+ by classical Ruby objects is added. A good example *might* be a test class,
99
+ which although is technically a Ruby class, has a significantly different purpose
100
+ in documentation and needs a different set of metadata, as well as its own
101
+ representation in documentation.
102
+
103
+ The {YARD::CodeObjects::Base#path} implementation is the most important part of the
104
+ code object architecture. The first thing any custom code object must guarantee is
105
+ that its path value is unique among all other objects. The recommended way to do this
106
+ with custom objects is to add a descriptive prefix to the path. For example, the
107
+ following is an implementation of the path for a hypothetical `FooObject`:
108
+
109
+ def path
110
+ "__FooPrefix" + sep + super
111
+ end
112
+
113
+ Note that if our FooObject is a `NamespaceObject`, meaning if it can have child
114
+ FooObjects defined inside of it, you may need to verify that the prefix is only
115
+ applied once.