yard 0.4.0 → 0.5.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 (121) hide show
  1. data/ChangeLog +585 -1
  2. data/README.md +10 -2
  3. data/benchmarks/yri_cache.rb +19 -0
  4. data/bin/yri +1 -26
  5. data/docs/WhatsNew.md +99 -0
  6. data/lib/rubygems_plugin.rb +2 -0
  7. data/lib/yard.rb +2 -2
  8. data/lib/yard/autoload.rb +9 -4
  9. data/lib/yard/cli/base.rb +26 -0
  10. data/lib/yard/cli/yard_graph.rb +2 -9
  11. data/lib/yard/cli/yardoc.rb +93 -33
  12. data/lib/yard/cli/yri.rb +128 -0
  13. data/lib/yard/code_objects/base.rb +16 -5
  14. data/lib/yard/code_objects/class_object.rb +11 -4
  15. data/lib/yard/code_objects/method_object.rb +11 -1
  16. data/lib/yard/code_objects/proxy.rb +5 -2
  17. data/lib/yard/code_objects/root_object.rb +1 -0
  18. data/lib/yard/core_ext/file.rb +1 -1
  19. data/lib/yard/core_ext/hash.rb +15 -0
  20. data/lib/yard/core_ext/module.rb +2 -2
  21. data/lib/yard/core_ext/string.rb +66 -0
  22. data/lib/yard/core_ext/symbol_hash.rb +1 -1
  23. data/lib/yard/docstring.rb +5 -5
  24. data/lib/yard/handlers/base.rb +10 -4
  25. data/lib/yard/handlers/processor.rb +3 -4
  26. data/lib/yard/handlers/ruby/attribute_handler.rb +3 -2
  27. data/lib/yard/handlers/ruby/legacy/attribute_handler.rb +2 -2
  28. data/lib/yard/handlers/ruby/legacy/method_handler.rb +7 -1
  29. data/lib/yard/handlers/ruby/method_handler.rb +7 -1
  30. data/lib/yard/logging.rb +11 -1
  31. data/lib/yard/parser/c_parser.rb +407 -0
  32. data/lib/yard/parser/ruby/ast_node.rb +2 -2
  33. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +3 -4
  34. data/lib/yard/parser/source_parser.rb +18 -7
  35. data/lib/yard/rake/yardoc_task.rb +1 -1
  36. data/lib/yard/registry.rb +83 -29
  37. data/lib/yard/registry_store.rb +213 -0
  38. data/lib/yard/serializers/base.rb +1 -1
  39. data/lib/yard/serializers/yardoc_serializer.rb +113 -0
  40. data/lib/yard/tags/library.rb +4 -0
  41. data/lib/yard/tags/overload_tag.rb +16 -5
  42. data/lib/yard/tags/tag.rb +1 -2
  43. data/lib/yard/templates/engine.rb +3 -3
  44. data/lib/yard/templates/helpers/html_helper.rb +50 -16
  45. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +1 -3
  46. data/lib/yard/templates/helpers/html_syntax_highlight_helper18.rb +1 -3
  47. data/lib/yard/templates/helpers/method_helper.rb +11 -4
  48. data/lib/yard/templates/helpers/text_helper.rb +24 -2
  49. data/lib/yard/verifier.rb +3 -3
  50. data/spec/cli/yardoc_spec.rb +33 -6
  51. data/spec/cli/yri_spec.rb +30 -0
  52. data/spec/code_objects/base_spec.rb +7 -0
  53. data/spec/code_objects/class_object_spec.rb +6 -1
  54. data/spec/code_objects/method_object_spec.rb +25 -0
  55. data/spec/core_ext/hash_spec.rb +10 -0
  56. data/spec/core_ext/module_spec.rb +1 -1
  57. data/spec/core_ext/string_spec.rb +50 -12
  58. data/spec/handlers/attribute_handler_spec.rb +4 -0
  59. data/spec/handlers/examples/method_handler_001.rb.txt +9 -0
  60. data/spec/handlers/method_handler_spec.rb +22 -4
  61. data/spec/parser/c_parser_spec.rb +22 -0
  62. data/spec/parser/examples/array.c.txt +3887 -0
  63. data/spec/parser/source_parser_spec.rb +29 -7
  64. data/spec/registry_spec.rb +93 -72
  65. data/spec/registry_store_spec.rb +184 -0
  66. data/spec/serializers/file_system_serializer_spec.rb +96 -75
  67. data/spec/spec_helper.rb +2 -2
  68. data/spec/tags/overload_tag_spec.rb +18 -0
  69. data/spec/templates/examples/class001.html +32 -30
  70. data/spec/templates/examples/method001.html +4 -1
  71. data/spec/templates/examples/method002.html +7 -2
  72. data/spec/templates/examples/method002.txt +1 -1
  73. data/spec/templates/examples/method003.html +30 -8
  74. data/spec/templates/examples/method003.txt +4 -4
  75. data/spec/templates/examples/method004.html +44 -0
  76. data/spec/templates/examples/method004.txt +10 -0
  77. data/spec/templates/examples/method005.html +99 -0
  78. data/spec/templates/examples/method005.txt +33 -0
  79. data/spec/templates/examples/module001.dot +1 -1
  80. data/spec/templates/examples/module001.html +391 -37
  81. data/spec/templates/examples/module001.txt +1 -1
  82. data/spec/templates/helpers/base_helper_spec.rb +2 -2
  83. data/spec/templates/helpers/html_helper_spec.rb +83 -0
  84. data/spec/templates/helpers/method_helper_spec.rb +47 -0
  85. data/spec/templates/helpers/shared_signature_examples.rb +102 -0
  86. data/spec/templates/helpers/text_helper_spec.rb +31 -0
  87. data/spec/templates/method_spec.rb +43 -18
  88. data/spec/templates/module_spec.rb +22 -1
  89. data/spec/templates/spec_helper.rb +10 -1
  90. data/spec/yard_spec.rb +4 -3
  91. data/templates/default/class/html/constructor_details.erb +1 -1
  92. data/templates/default/docstring/html/returns_void.erb +1 -0
  93. data/templates/default/docstring/setup.rb +9 -4
  94. data/templates/default/docstring/text/returns_void.erb +1 -0
  95. data/templates/default/fulldoc/html/css/style.css +4 -2
  96. data/templates/default/fulldoc/html/full_list.erb +2 -2
  97. data/templates/default/fulldoc/html/js/app.js +1 -1
  98. data/templates/default/fulldoc/html/setup.rb +14 -6
  99. data/templates/default/layout/dot/setup.rb +1 -1
  100. data/templates/default/layout/html/breadcrumb.erb +2 -2
  101. data/templates/default/layout/html/index.erb +2 -2
  102. data/templates/default/layout/html/setup.rb +5 -5
  103. data/templates/default/method/html/header.erb +6 -4
  104. data/templates/default/method_details/html/method_signature.erb +2 -1
  105. data/templates/default/method_details/html/source.erb +1 -1
  106. data/templates/default/method_details/setup.rb +2 -1
  107. data/templates/default/method_details/text/setup.rb +1 -1
  108. data/templates/default/module/html/attribute_details.erb +4 -4
  109. data/templates/default/module/html/attribute_summary.erb +3 -3
  110. data/templates/default/module/html/box_info.erb +2 -2
  111. data/templates/default/module/html/defines.erb +1 -1
  112. data/templates/default/module/html/inherited_constants.erb +1 -1
  113. data/templates/default/module/html/inherited_methods.erb +1 -1
  114. data/templates/default/module/html/item_summary.erb +13 -4
  115. data/templates/default/module/html/method_details_list.erb +5 -4
  116. data/templates/default/module/html/method_summary.erb +5 -4
  117. data/templates/default/module/html/methodmissing.erb +1 -1
  118. data/templates/default/module/setup.rb +14 -5
  119. data/templates/default/tags/html/overload.erb +3 -2
  120. data/templates/default/tags/setup.rb +4 -0
  121. metadata +23 -2
@@ -2,7 +2,15 @@ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  include YARD::Templates
4
4
 
5
+ def only_copy?(result, example, type)
6
+ if $COPY == :all || $COPY == example
7
+ puts(result) unless $COPYT && $COPYT != type
8
+ end
9
+ $COPY ? true : false
10
+ end
11
+
5
12
  def text_equals(result, expected_example)
13
+ return if only_copy?(result, expected_example, :text)
6
14
  text_equals_string(result, example(expected_example, :txt))
7
15
  end
8
16
 
@@ -11,6 +19,7 @@ def text_equals_string(result, expected)
11
19
  end
12
20
 
13
21
  def html_equals(result, expected_example)
22
+ return if only_copy?(result, expected_example, :html)
14
23
  html_equals_string(result, example(expected_example))
15
24
  end
16
25
 
@@ -19,7 +28,7 @@ def html_equals_string(result, expected)
19
28
  value.gsub!(/(>)\s+|\s+(<)/, '\1\2')
20
29
  value.strip!
21
30
  end
22
- result.should == expected
31
+ text_equals_string(result, expected)
23
32
  end
24
33
 
25
34
  def example(filename, ext = 'html')
data/spec/yard_spec.rb CHANGED
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), "spec_helper")
3
3
  describe YARD do
4
4
  describe '.load_plugins' do
5
5
  it "should load any plugin starting with 'yard_' or 'yard-'" do
6
- plugins = {
6
+ plugins = {
7
7
  'yard' => mock('yard'),
8
8
  'yard_plugin' => mock('yard_plugin'),
9
9
  'yard-plugin' => mock('yard-plugin'),
@@ -13,8 +13,9 @@ describe YARD do
13
13
  plugins.each do |k, v|
14
14
  v.should_receive(:name).at_least(1).times.and_return(k)
15
15
  end
16
+
16
17
  source_mock = mock(:source_index)
17
- source_mock.should_receive(:entries).and_return(plugins)
18
+ source_mock.should_receive(:find_name).with('').and_return(plugins.values)
18
19
  Gem.should_receive(:source_index).and_return(source_mock)
19
20
  YARD.should_receive(:require).with('yard_plugin').and_return(true)
20
21
  YARD.should_receive(:require).with('yard-plugin').and_return(true)
@@ -34,7 +35,7 @@ describe YARD do
34
35
  v.should_receive(:name).at_least(1).times.and_return(k)
35
36
  end
36
37
  source_mock = mock(:source_index)
37
- source_mock.should_receive(:entries).and_return(plugins)
38
+ source_mock.should_receive(:find_name).with('').and_return(plugins.values)
38
39
  File.should_receive(:file?).with(path).and_return(true)
39
40
  IO.should_receive(:read).with(path).and_return('yard-plugin yard-plugin2')
40
41
  Gem.should_receive(:source_index).and_return(source_mock)
@@ -1,4 +1,4 @@
1
- <div id="constructor_details">
1
+ <div id="constructor_details" class="method_details_list">
2
2
  <h2>Constructor Details</h2>
3
3
  <% if @ctor.namespace != object %>
4
4
  <p class="notice">This class inherits a constructor from <%= linkify @ctor, @ctor.namespace.path %></p>
@@ -0,0 +1 @@
1
+ <p class="note returns_void">This method returns an undefined value.</p>
@@ -1,6 +1,6 @@
1
1
  def init
2
2
  return if object.docstring.blank?
3
- sections :index, [:deprecated, :abstract, :todo, :note, :text], T('tags')
3
+ sections :index, [:deprecated, :abstract, :todo, :note, :returns_void, :text], T('tags')
4
4
  end
5
5
 
6
6
  def abstract
@@ -23,11 +23,16 @@ def note
23
23
  erb(:note)
24
24
  end
25
25
 
26
+ def returns_void
27
+ return unless object.type == :method
28
+ return if object.name == :initialize && object.scope == :instance
29
+ return unless object.tags(:return).size == 1 && object.tag(:return).types == ['void']
30
+ erb(:returns_void)
31
+ end
32
+
26
33
  def docstring_text
27
34
  text = ""
28
- if object.tags(:overload).size == 1 && object.docstring.empty?
29
- text = object.tag(:overload).docstring
30
- else
35
+ unless object.tags(:overload).size == 1 && object.docstring.empty?
31
36
  text = object.docstring
32
37
  end
33
38
 
@@ -0,0 +1 @@
1
+ <%= indent(wrap("This method returns an undefined value.")) %>
@@ -26,9 +26,11 @@ h2 {
26
26
  background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
27
27
  }
28
28
  .note.todo { background: #ffffc5; border-color: #ececaa; }
29
+ .note.returns_void { background: #efefef; }
29
30
  .note.deprecated { background: #ffe5e5; border-color: #e9dada; }
30
31
  .note.title { text-transform: lowercase; padding: 1px 5px; margin-left: 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; }
31
32
  h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
33
+ .note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
32
34
  .note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
33
35
  .note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
34
36
  .note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
@@ -111,7 +113,7 @@ p.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace;
111
113
  .tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
112
114
  .tags ul li { margin-bottom: 3px; }
113
115
  .tags ul .name { font-family: monospace; font-weight: bold; }
114
- .tags ul p { display: inline; margin-bottom: 5px; }
116
+ .tags ul p.note { padding: 3px 6px; }
115
117
  .tags { margin-bottom: 12px; }
116
118
 
117
119
  .tags .examples h3 { margin-bottom: 10px; }
@@ -169,7 +171,7 @@ p.children strong.modules { padding-left: 5px; }
169
171
  ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
170
172
  ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
171
173
  ul.fullTree li { text-align: center; }
172
- ul.fullTree li.next:before { font-size: 1.2em; content: ''; color: #bbb; display: block; margin-top: 3px; }
174
+ ul.fullTree li.next:before { font-size: 1.2em; content: '\2B06'; color: #bbb; display: block; margin-top: 3px; }
173
175
 
174
176
  #search { position: absolute; right: 14px; top: 0px; }
175
177
  #search a:link, #search a:visited {
@@ -19,11 +19,11 @@
19
19
  <li class="r<%= n %> <%= item.is_a?(CodeObjects::Base) && item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
20
20
  <% if @file_list %>
21
21
  <%= link_file item, File.basename(item).gsub(/\.[^.]+$/, '') %>
22
- <% elsif item == Registry.root %>
22
+ <% elsif item.root? %>
23
23
  <a href="top-level-namespace.html">Top Level Namespace</a>
24
24
  <% else %>
25
25
  <%= linkify item, item.name(true) %>
26
- <% if item.namespace && item.namespace != Registry.root %>
26
+ <% if item.namespace && !item.namespace.root? %>
27
27
  <small>(<%= item.namespace %>)</small>
28
28
  <% end %>
29
29
  <% end %>
@@ -1,5 +1,5 @@
1
1
  function createSourceLinks() {
2
- $('#method_details .source_code, #constructor_details .source_code, #method_missing_details .source_code').
2
+ $('.method_details_list .source_code').
3
3
  before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
4
4
  $('.toggleSource').toggle(function() {
5
5
  $(this).parent().next().slideDown(100);
@@ -1,7 +1,7 @@
1
1
  include Helpers::ModuleHelper
2
2
 
3
3
  def init
4
- objects = options[:objects]
4
+ options[:objects] = objects = run_verifier(options[:objects])
5
5
  options[:files] = ([options[:readme]] + options[:files]).compact.map {|t| t.to_s }
6
6
  options[:readme] = options[:files].first
7
7
  options[:title] ||= "Documentation by YARD #{YARD::VERSION}"
@@ -14,9 +14,15 @@ def init
14
14
 
15
15
  options.delete(:objects)
16
16
  options.delete(:files)
17
- objects.each do |object|
18
- next if options[:verifier] && options[:verifier].call(object).is_a?(FalseClass)
19
- serialize(object)
17
+
18
+ objects.each do |object|
19
+ begin
20
+ serialize(object)
21
+ rescue => e
22
+ path = options[:serializer].serialized_path(object)
23
+ log.error "Exception occurred while generating '#{path}'"
24
+ log.backtrace(e)
25
+ end
20
26
  end
21
27
  end
22
28
 
@@ -38,7 +44,7 @@ def serialize_file(file, title = nil)
38
44
  options[:object] = Registry.root
39
45
  options[:file] = file
40
46
  options[:page_title] = title
41
- options[:serialized_path] = 'file.' + File.basename(file.gsub(/\..+$/, '')) + '.html'
47
+ options[:serialized_path] = 'file.' + File.basename(file.gsub(/\.[^.]+$/, '')) + '.html'
42
48
 
43
49
  serialize_index(options) if file == options[:readme]
44
50
  Templates::Engine.with_serializer(options[:serialized_path], options[:serializer]) do
@@ -66,7 +72,9 @@ def generate_assets
66
72
  end
67
73
 
68
74
  def generate_method_list
69
- @items = prune_method_listing(Registry.all(:method)).sort_by {|m| m.name.to_s }
75
+ @items = prune_method_listing(Registry.all(:method), false)
76
+ @items = @items.reject {|m| m.name.to_s =~ /=$/ && m.is_attribute? }
77
+ @items = @items.sort_by {|m| m.name.to_s }
70
78
  @list_title = "Method List"
71
79
  asset('method_list.html', erb(:full_list))
72
80
  end
@@ -2,7 +2,7 @@ attr_reader :contents
2
2
 
3
3
  def init
4
4
  if object
5
- type = object == Registry.root ? :module : object.type
5
+ type = object.root? ? :module : object.type
6
6
  sections :header, [T(type)]
7
7
  else
8
8
  sections :header, [:contents]
@@ -1,9 +1,9 @@
1
1
  <div id="menu">
2
2
  <% if object.is_a?(CodeObjects::Base) && @file.nil? %>
3
- <a href="<%= url_for('_index.html') %>"><% if Registry.root == object || object.type == :method %>Index<% else %>Index (<%= object.name.to_s[0,1] %>)<% end %></a> &raquo;
3
+ <a href="<%= url_for('_index.html') %>"><% if object.root? || object.type == :method %>Index<% else %>Index (<%= object.name.to_s[0,1] %>)<% end %></a> &raquo;
4
4
  <%= @breadcrumb.map {|obj| linkify obj, obj.name }.join(" &raquo; ") %>
5
5
  <%= @breadcrumb.size > 0 ? " &raquo; " : "" %>
6
- <span class="title"><%= Registry.root == object ? "Top Level Namespace" : object.name(true) %></span>
6
+ <span class="title"><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
7
7
  <% else %>
8
8
  <% if object != '_index.html' %><%= link_url('_index.html', 'Index') %> &raquo; <% end %>
9
9
  <span class="title"><%= @breadcrumb_title %></span>
@@ -7,7 +7,7 @@
7
7
  <ul id="files">
8
8
  <% n = 1 %>
9
9
  <% @files.each_with_index do |file, i| %>
10
- <li class="r<%= n %>"><%= link_file(file, File.basename(file).gsub(/\..+$/, '')) %></li>
10
+ <li class="r<%= n %>"><%= link_file(file, File.basename(file).gsub(/\.[^.]+$/, '')) %></li>
11
11
  <% n = n == 2 ? 1 : 2 %>
12
12
  <% end %>
13
13
  </ul>
@@ -35,7 +35,7 @@
35
35
  <% objects.each do |obj| %>
36
36
  <li>
37
37
  <%= linkify obj, obj.name %>
38
- <% if obj.namespace != Registry.root %>
38
+ <% if !obj.namespace.root? %>
39
39
  <small>(<%= obj.namespace.path %>)</small>
40
40
  <% end %>
41
41
  </li>
@@ -4,7 +4,7 @@ def init
4
4
  if @file
5
5
  @contents = IO.read(@file)
6
6
  @file = File.basename(@file)
7
- @fname = @file.gsub(/\..+$/, '')
7
+ @fname = @file.gsub(/\.[^.]+$/, '')
8
8
  @breadcrumb_title = "File: " + @fname
9
9
  @page_title ||= @breadcrumb_title
10
10
  sections :layout, [:diskfile]
@@ -14,16 +14,16 @@ def init
14
14
  @page_title = options[:title]
15
15
  sections :layout, [:index]
16
16
  when CodeObjects::Base
17
- if object != Registry.root
17
+ unless object.root?
18
18
  cur = object.namespace
19
- while cur != Registry.root
19
+ while !cur.root?
20
20
  @breadcrumb.unshift(cur)
21
21
  cur = cur.namespace
22
22
  end
23
23
  end
24
24
 
25
25
  @page_title = format_object_title(object)
26
- type = object == Registry.root ? :module : object.type
26
+ type = object.root? ? :module : object.type
27
27
  sections :layout, [T(type)]
28
28
  end
29
29
  else
@@ -37,7 +37,7 @@ end
37
37
 
38
38
  def index
39
39
  @objects_by_letter = {}
40
- objects = @objects.reject {|o| o == Registry.root }.sort_by {|o| o.name.to_s }
40
+ objects = @objects.reject {|o| o.root? }.sort_by {|o| o.name.to_s }
41
41
  objects.each {|o| (@objects_by_letter[o.name.to_s[0,1].upcase] ||= []) << o }
42
42
  erb(:index)
43
43
  end
@@ -3,12 +3,14 @@
3
3
  <dt class="r1 last">Defined in:</dt>
4
4
  <dd class="r1 last">
5
5
  <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br />
6
- <%= object.files[1..-1].map(&:first).join(",<br /> ") %></div>
6
+ <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></div>
7
7
  <% end %>
8
8
  </dd>
9
9
  </dl>
10
10
  <div class="clear"></div>
11
11
 
12
- <div id="method_details">
13
- <%= yieldall :index => 0 %>
14
- </div>
12
+ <div class="method_details_list">
13
+ <div id="method_details">
14
+ <%= yieldall :index => 0 %>
15
+ </div>
16
+ </div>
@@ -11,7 +11,8 @@
11
11
 
12
12
  <% if object.aliases.size > 0 %>
13
13
  <span class="aliases">Also known as:
14
- <span class="names"><%= object.aliases.map {|o| h(o.name.to_s) }.join(", ") %></span>
14
+ <span class="names"><%= object.aliases.map {|o|
15
+ "<span id='#{anchor_for(o)}'>" + h(o.name.to_s) + "</span>" }.join(", ") %></span>
15
16
  </span>
16
17
  <% end %>
17
18
  </p>
@@ -4,7 +4,7 @@
4
4
  <pre class="lines"><%= "\n\n\n" %><%= h format_lines(object) %></pre>
5
5
  </td>
6
6
  <td>
7
- <pre class="code"><span class="info file"># File '<%= h object.file %>', line <%= object.line %></span><%= "\n\n" %><%= html_syntax_highlight object.source %></pre>
7
+ <pre class="code"><span class="info file"># File '<%= h object.file %>'<% if object.line %>, line <%= object.line %><% end %></span><%= "\n\n" %><%= html_syntax_highlight object.source, object.source_type %></pre>
8
8
  </td>
9
9
  </tr>
10
10
  </table>
@@ -3,6 +3,7 @@ def init
3
3
  end
4
4
 
5
5
  def source
6
- return if object.tags(:overload).size > 1
6
+ return if Tags::OverloadTag === object
7
+ return if object.source.nil?
7
8
  erb(:source)
8
9
  end
@@ -5,6 +5,6 @@ end
5
5
 
6
6
  def format_object_title(object)
7
7
  title = "Method: #{object.name(true)}"
8
- title += " (#{object.namespace})" if object.namespace != Registry.root
8
+ title += " (#{object.namespace})" if !object.namespace.root?
9
9
  title
10
10
  end
@@ -1,7 +1,7 @@
1
- <% if attr_listing.size > 0 %>
2
- <div id="attr_details">
3
- <h2>Attribute Details</h2>
4
- <% attr_listing.each_with_index do |meth, i| %>
1
+ <% scopes(attr_listing) do |list, scope| %>
2
+ <div id="<%= scope %>_attr_details" class="attr_details">
3
+ <h2><%= scope.to_s.capitalize %> Attribute Details</h2>
4
+ <% list.each_with_index do |meth, i| %>
5
5
  <% rw = meth.namespace.attributes[meth.scope][meth.name.to_s.gsub(/=$/, '').to_sym] %>
6
6
  <span id="<%= anchor_for(rw[:write]) %>"></span>
7
7
  <span id="<%= anchor_for(rw[:read]) %>"></span>
@@ -1,7 +1,7 @@
1
- <% if attr_listing.size > 0 %>
2
- <h2>Attribute Summary</h2>
1
+ <% scopes(attr_listing) do |list, scope| %>
2
+ <h2><%= scope.to_s.capitalize %> Attribute Summary</h2>
3
3
  <ul class="summary">
4
- <% attr_listing.each do |meth| %>
4
+ <% list.each do |meth| %>
5
5
  <%= yieldall :item => meth %>
6
6
  <% end %>
7
7
  </ul>
@@ -4,7 +4,7 @@
4
4
  <dt class="r<%=n%>">Inherits:</dt>
5
5
  <dd class="r<%=n%>">
6
6
  <span class="inheritName"><%= linkify object.superclass %></span>
7
- <% if object.superclass.name != :Object %>
7
+ <% if object.superclass.name != :BasicObject %>
8
8
  <ul class="fullTree">
9
9
  <li><%= linkify P(:Object) %></li>
10
10
  <% object.inheritance_tree.reverse.each_with_index do |obj, i| %>
@@ -23,7 +23,7 @@
23
23
  <% n = n == 2 ? 1 : 2 %>
24
24
  <% end %>
25
25
  <% end %>
26
- <% unless object == Registry.root %>
26
+ <% unless object.root? %>
27
27
  <dt class="r<%=n%> last">Defined in:</dt>
28
28
  <dd class="r<%=n%> last"><%= erb(:defines) %></dd>
29
29
  <% end %>
@@ -1,3 +1,3 @@
1
1
  <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br />
2
- <%= object.files[1..-1].map(&:first).join(",<br /> ") %></span>
2
+ <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></span>
3
3
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <% object.inheritance_tree(true)[1..-1].each do |superclass| %>
2
2
  <% next if superclass.is_a?(YARD::CodeObjects::Proxy) %>
3
- <% consts = superclass.constants(:included => false, :inherited => false) %>
3
+ <% consts = run_verifier superclass.constants(:included => false, :inherited => false) %>
4
4
  <% consts.reject! {|m| object.child(:scope => :class, :name => m.name) != nil } %>
5
5
  <% next if consts.size == 0 %>
6
6
  <h3 class="inherited">Constants <%= superclass.type == :class ? 'inherited' : 'included' %> from <%= linkify superclass %></h3>
@@ -1,6 +1,6 @@
1
1
  <% object.inheritance_tree(true)[1..-1].each do |superclass| %>
2
2
  <% next if superclass.is_a?(YARD::CodeObjects::Proxy) %>
3
- <% meths = superclass.meths(:included => false, :inherited => false) %>
3
+ <% meths = prune_method_listing(superclass.meths(:included => false, :inherited => false)) %>
4
4
  <% meths.reject! {|m| object.child(:scope => m.scope, :name => m.name) != nil } %>
5
5
  <% meths.reject! {|m| m.is_alias? || m.is_attribute? } %>
6
6
  <% next if meths.size == 0 %>
@@ -1,9 +1,18 @@
1
1
  <li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
2
- <span class="summary_signature"><%= signature(@item, true, false) %>
3
- <% if @item.aliases.size > 0 %>
4
- (also: <%= @item.aliases.map {|o| h(o.name(true)) }.join(", ") %>)
5
- <% end %>
2
+ <span class="summary_signature">
3
+ <% if @item.tags(:overload).size == 1 %>
4
+ <%= signature(@item.tag(:overload), true, false) %>
5
+ <% else %>
6
+ <%= signature(@item, true, false) %>
7
+ <% end %>
8
+
9
+ <% if @item.aliases.size > 0 %>
10
+ (also: <%= @item.aliases.map {|o| h(o.name(true)) }.join(", ") %>)
11
+ <% end %>
6
12
  </span>
13
+ <% if @item.constructor? %>
14
+ <span class="note title constructor">constructor</span>
15
+ <% end %>
7
16
  <% if rw = @item.namespace.attributes[@item.scope][@item.name] %>
8
17
  <% if rw[:read] && !rw[:write] %><span class="note title readonly">readonly</span><% end %>
9
18
  <% if rw[:write] && !rw[:read] %><span class="note title writeonly">writeonly</span><% end %>
@@ -1,7 +1,8 @@
1
- <% if method_listing(false).size > 0 %>
2
- <div id="method_details">
3
- <h2>Method Details</h2>
4
- <% method_listing(false).each_with_index do |meth, i| %>
1
+ <% scopes(method_listing(false)) do |list, scope| %>
2
+ <div id="<%= scope %>_method_details" class="method_details_list">
3
+ <h2><%= scope.to_s.capitalize %> Method Details</h2>
4
+
5
+ <% list.each_with_index do |meth, i| %>
5
6
  <%= yieldall :object => meth, :index => i %>
6
7
  <% end %>
7
8
  </div>