yard 0.8.7.6 → 0.9.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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -1
  3. data/LICENSE +2 -2
  4. data/README.md +2 -2
  5. data/Rakefile +1 -1
  6. data/bin/yard +0 -0
  7. data/bin/yardoc +0 -0
  8. data/bin/yri +0 -0
  9. data/docs/GettingStarted.md +88 -6
  10. data/docs/images/handlers-class-diagram.png +0 -0
  11. data/docs/images/overview-class-diagram.png +0 -0
  12. data/docs/images/parser-class-diagram.png +0 -0
  13. data/docs/templates/default/fulldoc/html/full_list_tag.erb +6 -4
  14. data/lib/yard/autoload.rb +3 -0
  15. data/lib/yard/cli/yardoc.rb +1 -1
  16. data/lib/yard/code_objects/base.rb +4 -1
  17. data/lib/yard/code_objects/extra_file_object.rb +3 -1
  18. data/lib/yard/code_objects/proxy.rb +2 -2
  19. data/lib/yard/docstring.rb +11 -6
  20. data/lib/yard/handlers/base.rb +1 -2
  21. data/lib/yard/handlers/c/base.rb +19 -0
  22. data/lib/yard/handlers/c/handler_methods.rb +42 -8
  23. data/lib/yard/handlers/c/init_handler.rb +1 -1
  24. data/lib/yard/handlers/c/method_handler.rb +3 -3
  25. data/lib/yard/handlers/ruby/decorator_handler_methods.rb +132 -0
  26. data/lib/yard/handlers/ruby/legacy/private_class_method_handler.rb +1 -1
  27. data/lib/yard/handlers/ruby/private_class_method_handler.rb +6 -39
  28. data/lib/yard/handlers/ruby/private_constant_handler.rb +36 -30
  29. data/lib/yard/handlers/ruby/public_class_method_handler.rb +13 -0
  30. data/lib/yard/handlers/ruby/struct_handler_methods.rb +1 -0
  31. data/lib/yard/handlers/ruby/visibility_handler.rb +5 -8
  32. data/lib/yard/logging.rb +1 -0
  33. data/lib/yard/parser/ruby/ruby_parser.rb +2 -2
  34. data/lib/yard/parser/source_parser.rb +6 -6
  35. data/lib/yard/rake/yardoc_task.rb +2 -2
  36. data/lib/yard/serializers/file_system_serializer.rb +33 -1
  37. data/lib/yard/server/commands/display_file_command.rb +8 -3
  38. data/lib/yard/server/commands/display_object_command.rb +7 -3
  39. data/lib/yard/server/doc_server_helper.rb +2 -8
  40. data/lib/yard/server/doc_server_serializer.rb +2 -4
  41. data/lib/yard/server/router.rb +1 -1
  42. data/lib/yard/server/templates/default/fulldoc/html/css/custom.css +57 -8
  43. data/lib/yard/server/templates/default/layout/html/breadcrumb.erb +2 -10
  44. data/lib/yard/server/templates/default/layout/html/script_setup.erb +1 -2
  45. data/lib/yard/server/templates/default/method_details/html/permalink.erb +3 -3
  46. data/lib/yard/server/templates/doc_server/processing/html/processing.erb +4 -4
  47. data/lib/yard/tags/directives.rb +1 -0
  48. data/lib/yard/tags/library.rb +9 -7
  49. data/lib/yard/tags/overload_tag.rb +4 -1
  50. data/lib/yard/templates/helpers/html_helper.rb +4 -3
  51. data/lib/yard/templates/template_options.rb +3 -0
  52. data/lib/yard/version.rb +1 -1
  53. data/spec/cli/command_parser_spec.rb +14 -14
  54. data/spec/cli/command_spec.rb +11 -11
  55. data/spec/cli/config_spec.rb +32 -32
  56. data/spec/cli/diff_spec.rb +86 -90
  57. data/spec/cli/display_spec.rb +6 -6
  58. data/spec/cli/gems_spec.rb +28 -28
  59. data/spec/cli/graph_spec.rb +8 -8
  60. data/spec/cli/help_spec.rb +8 -8
  61. data/spec/cli/i18n_spec.rb +33 -37
  62. data/spec/cli/list_spec.rb +2 -2
  63. data/spec/cli/markup_types_spec.rb +3 -3
  64. data/spec/cli/server_spec.rb +74 -88
  65. data/spec/cli/stats_spec.rb +14 -14
  66. data/spec/cli/yardoc_spec.rb +316 -321
  67. data/spec/cli/yri_spec.rb +45 -45
  68. data/spec/code_objects/base_spec.rb +174 -173
  69. data/spec/code_objects/class_object_spec.rb +65 -65
  70. data/spec/code_objects/code_object_list_spec.rb +13 -11
  71. data/spec/code_objects/constants_spec.rb +68 -58
  72. data/spec/code_objects/extra_file_object_spec.rb +71 -59
  73. data/spec/code_objects/macro_object_spec.rb +64 -64
  74. data/spec/code_objects/method_object_spec.rb +80 -72
  75. data/spec/code_objects/module_object_spec.rb +47 -47
  76. data/spec/code_objects/namespace_object_spec.rb +51 -51
  77. data/spec/code_objects/proxy_spec.rb +54 -54
  78. data/spec/config_spec.rb +104 -104
  79. data/spec/core_ext/array_spec.rb +5 -5
  80. data/spec/core_ext/file_spec.rb +33 -33
  81. data/spec/core_ext/hash_spec.rb +5 -5
  82. data/spec/core_ext/insertion_spec.rb +18 -18
  83. data/spec/core_ext/module_spec.rb +6 -6
  84. data/spec/core_ext/string_spec.rb +17 -17
  85. data/spec/core_ext/symbol_hash_spec.rb +42 -39
  86. data/spec/docstring_parser_spec.rb +65 -65
  87. data/spec/docstring_spec.rb +137 -130
  88. data/spec/handlers/alias_handler_spec.rb +39 -39
  89. data/spec/handlers/attribute_handler_spec.rb +35 -35
  90. data/spec/handlers/base_spec.rb +60 -51
  91. data/spec/handlers/c/alias_handler_spec.rb +6 -6
  92. data/spec/handlers/c/attribute_handler_spec.rb +12 -12
  93. data/spec/handlers/c/class_handler_spec.rb +35 -22
  94. data/spec/handlers/c/constant_handler_spec.rb +24 -22
  95. data/spec/handlers/c/init_handler_spec.rb +10 -10
  96. data/spec/handlers/c/method_handler_spec.rb +150 -65
  97. data/spec/handlers/c/mixin_handler_spec.rb +5 -5
  98. data/spec/handlers/c/module_handler_spec.rb +27 -15
  99. data/spec/handlers/c/override_comment_handler_spec.rb +14 -14
  100. data/spec/handlers/c/path_handler_spec.rb +8 -8
  101. data/spec/handlers/c/spec_helper.rb +10 -0
  102. data/spec/handlers/c/struct_handler_spec.rb +3 -3
  103. data/spec/handlers/class_condition_handler_spec.rb +18 -18
  104. data/spec/handlers/class_handler_spec.rb +97 -97
  105. data/spec/handlers/class_method_handler_shared_examples.rb +132 -0
  106. data/spec/handlers/class_variable_handler_spec.rb +3 -3
  107. data/spec/handlers/constant_handler_spec.rb +32 -29
  108. data/spec/handlers/decorator_handler_methods_spec.rb +405 -0
  109. data/spec/handlers/dsl_handler_spec.rb +108 -109
  110. data/spec/handlers/examples/constant_handler_001.rb.txt +4 -1
  111. data/spec/handlers/examples/visibility_handler_001.rb.txt +4 -0
  112. data/spec/handlers/exception_handler_spec.rb +23 -23
  113. data/spec/handlers/extend_handler_spec.rb +9 -9
  114. data/spec/handlers/legacy_base_spec.rb +60 -60
  115. data/spec/handlers/method_condition_handler_spec.rb +5 -5
  116. data/spec/handlers/method_handler_spec.rb +92 -92
  117. data/spec/handlers/mixin_handler_spec.rb +25 -25
  118. data/spec/handlers/module_function_handler_spec.rb +24 -24
  119. data/spec/handlers/module_handler_spec.rb +15 -15
  120. data/spec/handlers/private_class_method_handler_spec.rb +4 -48
  121. data/spec/handlers/private_constant_handler_spec.rb +8 -8
  122. data/spec/handlers/processor_spec.rb +12 -12
  123. data/spec/handlers/public_class_method_handler_spec.rb +10 -0
  124. data/spec/handlers/ruby/base_spec.rb +16 -16
  125. data/spec/handlers/ruby/legacy/base_spec.rb +20 -18
  126. data/spec/handlers/spec_helper.rb +1 -1
  127. data/spec/handlers/visibility_handler_spec.rb +25 -21
  128. data/spec/handlers/yield_handler_spec.rb +28 -28
  129. data/spec/i18n/locale_spec.rb +16 -16
  130. data/spec/i18n/message_spec.rb +8 -8
  131. data/spec/i18n/messages_spec.rb +14 -14
  132. data/spec/i18n/pot_generator_spec.rb +32 -32
  133. data/spec/i18n/text_spec.rb +22 -22
  134. data/spec/logging_spec.rb +12 -12
  135. data/spec/options_spec.rb +56 -56
  136. data/spec/parser/base_spec.rb +9 -9
  137. data/spec/parser/c_parser_spec.rb +50 -50
  138. data/spec/parser/ruby/ast_node_spec.rb +7 -7
  139. data/spec/parser/ruby/legacy/statement_list_spec.rb +106 -106
  140. data/spec/parser/ruby/legacy/token_list_spec.rb +27 -27
  141. data/spec/parser/ruby/ruby_parser_spec.rb +123 -113
  142. data/spec/parser/source_parser_spec.rb +224 -224
  143. data/spec/parser/tag_parsing_spec.rb +6 -7
  144. data/spec/rake/yardoc_task_spec.rb +38 -48
  145. data/spec/registry_spec.rb +143 -143
  146. data/spec/registry_store_spec.rb +165 -165
  147. data/spec/rubygems/doc_manager_spec.rb +38 -38
  148. data/spec/serializers/file_system_serializer_spec.rb +53 -33
  149. data/spec/serializers/yardoc_serializer_spec.rb +15 -15
  150. data/spec/server/adapter_spec.rb +15 -15
  151. data/spec/server/commands/base_spec.rb +29 -29
  152. data/spec/server/commands/library_command_spec.rb +12 -12
  153. data/spec/server/commands/static_file_command_spec.rb +28 -28
  154. data/spec/server/doc_server_helper_spec.rb +8 -8
  155. data/spec/server/doc_server_serializer_spec.rb +23 -18
  156. data/spec/server/rack_adapter_spec.rb +6 -6
  157. data/spec/server/router_spec.rb +39 -39
  158. data/spec/server/static_caching_spec.rb +16 -16
  159. data/spec/server/webrick_servlet_spec.rb +6 -7
  160. data/spec/server_spec.rb +3 -3
  161. data/spec/spec_helper.rb +11 -2
  162. data/spec/tags/default_factory_spec.rb +64 -64
  163. data/spec/tags/default_tag_spec.rb +5 -5
  164. data/spec/tags/directives_spec.rb +121 -121
  165. data/spec/tags/library_spec.rb +14 -14
  166. data/spec/tags/overload_tag_spec.rb +24 -24
  167. data/spec/tags/ref_tag_list_spec.rb +12 -12
  168. data/spec/templates/class_spec.rb +3 -3
  169. data/spec/templates/constant_spec.rb +4 -4
  170. data/spec/templates/engine_spec.rb +47 -48
  171. data/spec/templates/examples/class001.html +129 -101
  172. data/spec/templates/examples/class002.html +31 -27
  173. data/spec/templates/examples/method001.html +54 -47
  174. data/spec/templates/examples/method002.html +33 -28
  175. data/spec/templates/examples/method003.html +70 -64
  176. data/spec/templates/examples/method004.html +13 -9
  177. data/spec/templates/examples/method005.html +38 -32
  178. data/spec/templates/examples/module001.html +343 -339
  179. data/spec/templates/examples/module002.html +147 -124
  180. data/spec/templates/examples/module003.html +94 -81
  181. data/spec/templates/examples/module004.html +40 -33
  182. data/spec/templates/helpers/base_helper_spec.rb +91 -95
  183. data/spec/templates/helpers/html_helper_spec.rb +276 -279
  184. data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +16 -15
  185. data/spec/templates/helpers/markup/rdoc_markup_spec.rb +27 -34
  186. data/spec/templates/helpers/markup_helper_spec.rb +57 -57
  187. data/spec/templates/helpers/method_helper_spec.rb +20 -20
  188. data/spec/templates/helpers/shared_signature_examples.rb +33 -31
  189. data/spec/templates/helpers/text_helper_spec.rb +6 -6
  190. data/spec/templates/method_spec.rb +7 -7
  191. data/spec/templates/module_spec.rb +7 -7
  192. data/spec/templates/onefile_spec.rb +7 -7
  193. data/spec/templates/section_spec.rb +66 -69
  194. data/spec/templates/spec_helper.rb +1 -1
  195. data/spec/templates/tag_spec.rb +5 -5
  196. data/spec/templates/template_spec.rb +158 -158
  197. data/spec/verifier_spec.rb +52 -52
  198. data/templates/default/fulldoc/html/css/full_list.css +32 -31
  199. data/templates/default/fulldoc/html/css/style.css +212 -77
  200. data/templates/default/fulldoc/html/frames.erb +6 -15
  201. data/templates/default/fulldoc/html/full_list.erb +14 -21
  202. data/templates/default/fulldoc/html/full_list_class.erb +1 -1
  203. data/templates/default/fulldoc/html/full_list_file.erb +6 -4
  204. data/templates/default/fulldoc/html/full_list_method.erb +8 -6
  205. data/templates/default/fulldoc/html/js/app.js +100 -76
  206. data/templates/default/fulldoc/html/js/full_list.js +170 -135
  207. data/templates/default/fulldoc/html/setup.rb +50 -7
  208. data/templates/default/layout/html/breadcrumb.erb +0 -2
  209. data/templates/default/layout/html/headers.erb +2 -1
  210. data/templates/default/layout/html/layout.erb +16 -10
  211. data/templates/default/layout/html/script_setup.erb +1 -2
  212. data/templates/default/layout/html/search.erb +7 -2
  213. data/templates/default/layout/html/setup.rb +16 -0
  214. data/templates/default/method/html/header.erb +7 -6
  215. data/templates/default/module/html/attribute_summary.erb +1 -1
  216. data/templates/default/module/html/box_info.erb +24 -18
  217. data/templates/default/module/html/constant_summary.erb +9 -11
  218. data/templates/default/module/html/item_summary.erb +1 -1
  219. data/templates/default/module/html/method_summary.erb +1 -1
  220. data/templates/guide/fulldoc/html/setup.rb +1 -1
  221. data/yard.gemspec +1 -2
  222. metadata +10 -7
  223. data/spec/handlers/examples/private_class_method_handler_001.rb.txt +0 -9
  224. data/spec/handlers/examples/private_class_method_handler_002.rb.txt +0 -18
  225. data/spec/handlers/examples/private_class_method_handler_003.rb.txt +0 -11
@@ -29,7 +29,7 @@ end
29
29
  # @param [CodeObject] object to be saved to HTML
30
30
  def serialize(object)
31
31
  options.object = object
32
- serialize_index(options) if object == '_index.html' && options.files.empty?
32
+ serialize_index(options) if object == '_index.html' && options.readme.nil?
33
33
  Templates::Engine.with_serializer(object, options.serializer) do
34
34
  T('layout').run(options)
35
35
  end
@@ -48,7 +48,7 @@ end
48
48
  # @params [Hash] options contains data and flags that influence the output
49
49
  def serialize_index(options)
50
50
  Templates::Engine.with_serializer('index.html', options.serializer) do
51
- T('layout').run(options)
51
+ T('layout').run(options.merge(:index => true))
52
52
  end
53
53
  end
54
54
 
@@ -172,28 +172,71 @@ def generate_frameset
172
172
  asset(url_for_frameset, erb(:frames))
173
173
  end
174
174
 
175
+ # @api private
176
+ class TreeContext
177
+
178
+ def initialize
179
+ @depth = 0
180
+ @even_odd = Alternator.new(:even, :odd)
181
+ end
182
+
183
+ def nest
184
+ @depth += 1
185
+ yield
186
+ @depth -= 1
187
+ end
188
+
189
+ # @return [String] Returns a css pixel offset, e.g. "30px"
190
+ def indent
191
+ "#{(@depth + 2) * 15}px"
192
+ end
193
+
194
+ def classes
195
+ classes = []
196
+ classes << 'collapsed' if @depth > 0
197
+ classes << @even_odd.next if @depth < 2
198
+ classes
199
+ end
200
+
201
+ class Alternator
202
+ def initialize(first, second)
203
+ @next = first
204
+ @after = second
205
+ end
206
+ def next
207
+ @next, @after = @after, @next
208
+ @after
209
+ end
210
+ end
211
+
212
+ end
213
+
175
214
  # @return [String] HTML output of the classes to be displayed in the
176
215
  # full_list_class template.
177
- def class_list(root = Registry.root)
216
+ def class_list(root = Registry.root, tree = TreeContext.new)
178
217
  out = ""
179
218
  children = run_verifier(root.children)
180
219
  if root == Registry.root
181
220
  children += @items.select {|o| o.namespace.is_a?(CodeObjects::Proxy) }
182
221
  end
183
- children.reject {|c| c.nil? }.sort_by {|child| child.path }.map do |child|
222
+ children.compact.sort_by(&:path).each do |child|
184
223
  if child.is_a?(CodeObjects::NamespaceObject)
185
224
  name = child.namespace.is_a?(CodeObjects::Proxy) ? child.path : child.name
186
225
  has_children = run_verifier(child.children).any? {|o| o.is_a?(CodeObjects::NamespaceObject) }
187
- out << "<li>"
226
+ out << "<li id='object_#{child.path}' class='#{tree.classes.join(' ')}'>"
227
+ out << "<div class='item' style='padding-left:#{tree.indent}'>"
188
228
  out << "<a class='toggle'></a> " if has_children
189
229
  out << linkify(child, name)
190
230
  out << " &lt; #{child.superclass.name}" if child.is_a?(CodeObjects::ClassObject) && child.superclass
191
231
  out << "<small class='search_info'>"
192
232
  out << child.namespace.title
193
233
  out << "</small>"
234
+ out << "</div>"
235
+ tree.nest do
236
+ out << "<ul>#{class_list(child, tree)}</ul>" if has_children
237
+ end
194
238
  out << "</li>"
195
- out << "<ul>#{class_list(child)}</ul>" if has_children
196
239
  end
197
240
  end
198
241
  out
199
- end
242
+ end
@@ -8,6 +8,4 @@
8
8
  <%= @breadcrumb.size > 0 ? " &raquo; " : "" %>
9
9
  <span class="title"><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
10
10
  <% end %>
11
-
12
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
13
11
  </div>
@@ -1,4 +1,5 @@
1
- <meta http-equiv="Content-Type" content="text/html; charset=<%= charset %>" />
1
+ <meta charset="<%= charset %>">
2
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
2
3
  <title>
3
4
  <%= h @page_title %>
4
5
  <% if options.title && @page_title != options.title %>
@@ -1,20 +1,26 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html>
4
3
  <head>
5
4
  <%= erb(:headers) %>
6
5
  </head>
7
6
  <body>
8
- <div id="header">
9
- <%= erb(:breadcrumb) %>
10
- <%= erb(:search) %>
11
- <div class="clear"></div>
7
+ <div class="nav_wrap">
8
+ <iframe id="nav" src="<%= @nav_url %>"></iframe>
9
+ <div id="resizer"></div>
12
10
  </div>
13
11
 
14
- <iframe id="search_frame"></iframe>
12
+ <div id="main" tabindex="-1">
13
+ <div id="header">
14
+ <%= erb(:breadcrumb) %>
15
+ <%= erb(:search) %>
16
+ <div class="clear"></div>
17
+ </div>
15
18
 
16
- <div id="content"><%= yieldall %></div>
19
+ <iframe id="search_frame" src="<%= @nav_url %>"></iframe>
17
20
 
18
- <%= erb(:footer) %>
21
+ <div id="content"><%= yieldall %></div>
22
+
23
+ <%= erb(:footer) %>
24
+ </div>
19
25
  </body>
20
26
  </html>
@@ -1,5 +1,4 @@
1
1
  <script type="text/javascript" charset="utf-8">
2
- hasFrames = window.top.frames.main ? true : false;
2
+ pathId = <%= @path ? @path.inspect : 'null' %>;
3
3
  relpath = '<%= u = url_for(''); u + (u != '' ? '/' : '') %>';
4
- framesUrl = "<%= url_for_frameset %>#!<%= url_for(@file || @object, nil, false) %>";
5
4
  </script>
@@ -1,8 +1,13 @@
1
1
  <div id="search">
2
- <% menu_lists.each do |field| %>
2
+ <% [menu_lists.first].each do |field| %>
3
3
  <a class="full_list_link" id="<%= field[:type] %>_list_link"
4
4
  href="<%= url_for_list(field[:type]) %>">
5
- <%= field[:search_title] %>
5
+
6
+ <svg width="24" height="24">
7
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
8
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
9
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
10
+ </svg>
6
11
  </a>
7
12
  <% end %>
8
13
  </div>
@@ -44,6 +44,22 @@ def index
44
44
  erb(:index)
45
45
  end
46
46
 
47
+ def layout
48
+ @nav_url = url_for_list(!@file || options.index ? 'class' : 'file')
49
+
50
+ if !object || object.is_a?(String)
51
+ @path = nil
52
+ elsif @file
53
+ @path = @file.path
54
+ elsif !object.is_a?(YARD::CodeObjects::NamespaceObject)
55
+ @path = object.parent.path
56
+ else
57
+ @path = object.path
58
+ end
59
+
60
+ erb(:layout)
61
+ end
62
+
47
63
  def diskfile
48
64
  @file.attributes[:markup] ||= markup_for_file('', @file.filename)
49
65
  data = htmlify(@file.contents, @file.attributes[:markup])
@@ -1,13 +1,14 @@
1
1
  <h1>Method: <%= object.path %></h1>
2
- <dl class="box">
3
- <dt class="r1 last">Defined in:</dt>
4
- <dd class="r1 last">
2
+ <div class="box_info">
3
+ <dl>
4
+ <dt class="">Defined in:</dt>
5
+ <dd class="">
5
6
  <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br />
6
7
  <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></div>
7
8
  <% end %>
8
- </dd>
9
- </dl>
10
- <div class="clear"></div>
9
+ </dd>
10
+ </dl>
11
+ </div>
11
12
 
12
13
  <div class="method_details_list">
13
14
  <div id="method_details">
@@ -1,5 +1,5 @@
1
1
  <% groups(attr_listing, "Attribute") do |list, name| %>
2
- <h2><%= name %> <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
2
+ <h2><%= name %> <small><a href="#" class="summary_toggle">collapse</a></small></h2>
3
3
  <ul class="summary">
4
4
  <% list.each do |meth| %>
5
5
  <%= yieldall :item => meth %>
@@ -1,8 +1,8 @@
1
- <% n = 1 %>
2
- <dl class="box">
1
+ <div class="box_info">
3
2
  <% if CodeObjects::ClassObject === object && object.superclass %>
4
- <dt class="r<%=n%>">Inherits:</dt>
5
- <dd class="r<%=n%>">
3
+ <dl>
4
+ <dt>Inherits:</dt>
5
+ <dd>
6
6
  <span class="inheritName"><%= linkify object.superclass %></span>
7
7
  <% if object.superclass.name != :BasicObject %>
8
8
  <ul class="fullTree">
@@ -13,25 +13,31 @@
13
13
  </ul>
14
14
  <a href="#" class="inheritanceTree">show all</a>
15
15
  <% end %>
16
- </dd>
17
- <% n = 2 %>
16
+ </dd>
17
+ </dl>
18
18
  <% end %>
19
+
19
20
  <% [[:class, "Extended by"], [:instance, "Includes"]].each do |scope, name| %>
20
- <% if (mix = run_verifier(object.mixins(scope))).size > 0 %>
21
- <dt class="r<%=n%>"><%= name %>:</dt>
22
- <dd class="r<%=n%>"><%= mix.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
23
- <% n = n == 2 ? 1 : 2 %>
24
- <% end %>
21
+ <% if (mix = run_verifier(object.mixins(scope))).size > 0 %>
22
+ <dl>
23
+ <dt><%= name %>:</dt>
24
+ <dd><%= mix.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
25
+ </dl>
26
+ <% end %>
25
27
  <% end %>
28
+
26
29
  <% if (mixed_into = mixed_into(object)).size > 0 %>
27
- <dt class="r<%=n%>">Included in:</dt>
28
- <dd class="r<%=n%>"><%= mixed_into.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
29
- <% n = n == 2 ? 1 : 2 %>
30
+ <dl>
31
+ <dt>Included in:</dt>
32
+ <dd><%= mixed_into.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
33
+ </dl>
30
34
  <% end %>
35
+
31
36
  <% unless object.root? %>
32
- <dt class="r<%=n%> last">Defined in:</dt>
33
- <dd class="r<%=n%> last"><%= erb(:defines) %></dd>
37
+ <dl>
38
+ <dt>Defined in:</dt>
39
+ <dd><%= erb(:defines) %></dd>
40
+ </dl>
34
41
  <% end %>
35
- </dl>
36
- <div class="clear"></div>
42
+ </div>
37
43
 
@@ -1,13 +1,11 @@
1
- <% if constant_listing.size > 0 || object.constants.size > 0 %>
1
+ <% if constant_listing.size > 0 %>
2
2
  <h2>Constant Summary</h2>
3
- <% if constant_listing.size > 0 %>
4
- <dl class="constants">
5
- <% constant_listing.each do |cnst| %>
6
- <dt id="<%= anchor_for(cnst) %>" class="<%= cnst.has_tag?(:deprecated) ? 'deprecated' : '' %>"><%= cnst.name %> =
7
- <%= yieldall :object => cnst %>
8
- </dt>
9
- <dd><pre class="code"><%= format_constant cnst.value %></pre></dd>
10
- <% end %>
11
- </dl>
12
- <% end %>
3
+ <dl class="constants">
4
+ <% constant_listing.each do |cnst| %>
5
+ <dt id="<%= anchor_for(cnst) %>" class="<%= cnst.has_tag?(:deprecated) ? 'deprecated' : '' %>"><%= cnst.name %> =
6
+ <%= yieldall :object => cnst %>
7
+ </dt>
8
+ <dd><pre class="code"><%= format_constant cnst.value %></pre></dd>
9
+ <% end %>
10
+ </dl>
13
11
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
2
2
  <span class="summary_signature">
3
3
  <% if @item.tags(:overload).size == 1 %>
4
- <%= signature(@item.tag(:overload), true, !@item.attr_info) %>
4
+ <%= signature(@item.tag(:overload), true, false, !@item.attr_info) %>
5
5
  <% else %>
6
6
  <%= signature(@item, true, false, !@item.attr_info) %>
7
7
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <% groups(method_listing) do |list, name| %>
3
3
  <h2>
4
4
  <%= name %>
5
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
5
+ <small><a href="#" class="summary_toggle">collapse</a></small>
6
6
  </h2>
7
7
 
8
8
  <ul class="summary">
@@ -34,7 +34,7 @@ def init
34
34
  generate_assets
35
35
  options.delete(:objects)
36
36
  options.files.each {|file| serialize_file(file) }
37
- serialize_file(options.readme)
37
+ serialize_file(options.readme) if options.readme
38
38
  end
39
39
 
40
40
  def generate_assets
@@ -20,6 +20,5 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ['lib']
21
21
  s.executables = ['yard', 'yardoc', 'yri']
22
22
  s.has_rdoc = 'yard'
23
- s.rubyforge_project = 'yard'
24
23
  s.license = 'MIT' if s.respond_to?(:license=)
25
- end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7.6
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-26 00:00:00.000000000 Z
11
+ date: 2016-07-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  YARD is a documentation generation tool for the Ruby programming language.
@@ -136,6 +136,7 @@ files:
136
136
  - lib/yard/handlers/ruby/class_variable_handler.rb
137
137
  - lib/yard/handlers/ruby/comment_handler.rb
138
138
  - lib/yard/handlers/ruby/constant_handler.rb
139
+ - lib/yard/handlers/ruby/decorator_handler_methods.rb
139
140
  - lib/yard/handlers/ruby/dsl_handler.rb
140
141
  - lib/yard/handlers/ruby/dsl_handler_methods.rb
141
142
  - lib/yard/handlers/ruby/exception_handler.rb
@@ -166,6 +167,7 @@ files:
166
167
  - lib/yard/handlers/ruby/module_handler.rb
167
168
  - lib/yard/handlers/ruby/private_class_method_handler.rb
168
169
  - lib/yard/handlers/ruby/private_constant_handler.rb
170
+ - lib/yard/handlers/ruby/public_class_method_handler.rb
169
171
  - lib/yard/handlers/ruby/struct_handler_methods.rb
170
172
  - lib/yard/handlers/ruby/visibility_handler.rb
171
173
  - lib/yard/handlers/ruby/yield_handler.rb
@@ -320,8 +322,10 @@ files:
320
322
  - spec/handlers/c/struct_handler_spec.rb
321
323
  - spec/handlers/class_condition_handler_spec.rb
322
324
  - spec/handlers/class_handler_spec.rb
325
+ - spec/handlers/class_method_handler_shared_examples.rb
323
326
  - spec/handlers/class_variable_handler_spec.rb
324
327
  - spec/handlers/constant_handler_spec.rb
328
+ - spec/handlers/decorator_handler_methods_spec.rb
325
329
  - spec/handlers/dsl_handler_spec.rb
326
330
  - spec/handlers/examples/alias_handler_001.rb.txt
327
331
  - spec/handlers/examples/attribute_handler_001.rb.txt
@@ -336,9 +340,6 @@ files:
336
340
  - spec/handlers/examples/method_handler_001.rb.txt
337
341
  - spec/handlers/examples/mixin_handler_001.rb.txt
338
342
  - spec/handlers/examples/module_handler_001.rb.txt
339
- - spec/handlers/examples/private_class_method_handler_001.rb.txt
340
- - spec/handlers/examples/private_class_method_handler_002.rb.txt
341
- - spec/handlers/examples/private_class_method_handler_003.rb.txt
342
343
  - spec/handlers/examples/private_constant_handler_001.rb.txt
343
344
  - spec/handlers/examples/process_handler_001.rb.txt
344
345
  - spec/handlers/examples/visibility_handler_001.rb.txt
@@ -354,6 +355,7 @@ files:
354
355
  - spec/handlers/private_class_method_handler_spec.rb
355
356
  - spec/handlers/private_constant_handler_spec.rb
356
357
  - spec/handlers/processor_spec.rb
358
+ - spec/handlers/public_class_method_handler_spec.rb
357
359
  - spec/handlers/ruby/base_spec.rb
358
360
  - spec/handlers/ruby/legacy/base_spec.rb
359
361
  - spec/handlers/spec_helper.rb
@@ -603,9 +605,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
603
605
  - !ruby/object:Gem::Version
604
606
  version: '0'
605
607
  requirements: []
606
- rubyforge_project: yard
607
- rubygems_version: 2.4.1
608
+ rubyforge_project:
609
+ rubygems_version: 2.5.1
608
610
  signing_key:
609
611
  specification_version: 4
610
612
  summary: Documentation tool for consistent and usable documentation in Ruby.
611
613
  test_files: []
614
+ has_rdoc: yard
@@ -1,9 +0,0 @@
1
- class A
2
- def self.b; end
3
- def self.c; end
4
- def self.d; end
5
- def self.e; end
6
-
7
- private_class_method(:c, :d)
8
- private_class_method("e")
9
- end
@@ -1,18 +0,0 @@
1
- class SingletonClass
2
-
3
- # Public
4
- def self.foo
5
- 'foo'
6
- end
7
-
8
- # Private
9
- def self.bar
10
- end
11
-
12
- # Private from reopening class.
13
- def self.baz
14
- end
15
-
16
- private_class_method :new, :bar
17
-
18
- end