yard 0.5.8 → 0.6.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.
- data/.yardopts +2 -0
- data/ChangeLog +1064 -0
- data/README.md +103 -42
- data/Rakefile +3 -2
- data/benchmarks/parsing.rb +2 -1
- data/bin/yard +4 -0
- data/bin/yard-graph +1 -1
- data/bin/yard-server +4 -0
- data/docs/GettingStarted.md +8 -8
- data/docs/Handlers.md +5 -5
- data/docs/Overview.md +5 -5
- data/docs/Parser.md +1 -1
- data/docs/Tags.md +1 -1
- data/docs/Templates.md +27 -6
- data/docs/WhatsNew.md +222 -2
- data/lib/rubygems_plugin.rb +1 -0
- data/lib/yard.rb +7 -1
- data/lib/yard/autoload.rb +46 -6
- data/lib/yard/cli/{base.rb → command.rb} +20 -6
- data/lib/yard/cli/command_parser.rb +87 -0
- data/lib/yard/cli/diff.rb +176 -0
- data/lib/yard/cli/gems.rb +74 -0
- data/lib/yard/cli/{yard_graph.rb → graph.rb} +9 -8
- data/lib/yard/cli/help.rb +18 -0
- data/lib/yard/cli/server.rb +137 -0
- data/lib/yard/cli/stats.rb +210 -0
- data/lib/yard/cli/yardoc.rb +315 -116
- data/lib/yard/cli/yri.rb +45 -4
- data/lib/yard/code_objects/base.rb +73 -30
- data/lib/yard/code_objects/class_object.rb +9 -1
- data/lib/yard/code_objects/method_object.rb +11 -0
- data/lib/yard/code_objects/namespace_object.rb +8 -2
- data/lib/yard/code_objects/proxy.rb +2 -2
- data/lib/yard/core_ext/array.rb +3 -49
- data/lib/yard/core_ext/file.rb +7 -0
- data/lib/yard/core_ext/insertion.rb +60 -0
- data/lib/yard/docstring.rb +34 -7
- data/lib/yard/globals.rb +2 -2
- data/lib/yard/handlers/base.rb +101 -20
- data/lib/yard/handlers/processor.rb +23 -7
- data/lib/yard/handlers/ruby/alias_handler.rb +1 -0
- data/lib/yard/handlers/ruby/attribute_handler.rb +8 -0
- data/lib/yard/handlers/ruby/base.rb +71 -2
- data/lib/yard/handlers/ruby/class_condition_handler.rb +10 -0
- data/lib/yard/handlers/ruby/class_handler.rb +7 -4
- data/lib/yard/handlers/ruby/class_variable_handler.rb +1 -0
- data/lib/yard/handlers/ruby/constant_handler.rb +1 -0
- data/lib/yard/handlers/ruby/exception_handler.rb +1 -0
- data/lib/yard/handlers/ruby/extend_handler.rb +2 -3
- data/lib/yard/handlers/ruby/legacy/alias_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/attribute_handler.rb +2 -0
- data/lib/yard/handlers/ruby/legacy/base.rb +15 -2
- data/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +5 -0
- data/lib/yard/handlers/ruby/legacy/class_handler.rb +7 -4
- data/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/constant_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/exception_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/extend_handler.rb +1 -3
- data/lib/yard/handlers/ruby/legacy/method_handler.rb +7 -3
- data/lib/yard/handlers/ruby/legacy/mixin_handler.rb +2 -1
- data/lib/yard/handlers/ruby/legacy/module_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/process_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/visibility_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/yield_handler.rb +1 -0
- data/lib/yard/handlers/ruby/method_condition_handler.rb +1 -0
- data/lib/yard/handlers/ruby/method_handler.rb +5 -1
- data/lib/yard/handlers/ruby/mixin_handler.rb +2 -1
- data/lib/yard/handlers/ruby/module_handler.rb +1 -0
- data/lib/yard/handlers/ruby/process_handler.rb +7 -1
- data/lib/yard/handlers/ruby/struct_handler_methods.rb +3 -0
- data/lib/yard/handlers/ruby/visibility_handler.rb +8 -2
- data/lib/yard/handlers/ruby/yield_handler.rb +1 -0
- data/lib/yard/logging.rb +7 -1
- data/lib/yard/parser/base.rb +1 -0
- data/lib/yard/parser/c_parser.rb +2 -0
- data/lib/yard/parser/ruby/ast_node.rb +82 -63
- data/lib/yard/parser/ruby/legacy/ruby_lex.rb +36 -10
- data/lib/yard/parser/ruby/legacy/ruby_parser.rb +1 -0
- data/lib/yard/parser/ruby/legacy/statement.rb +9 -5
- data/lib/yard/parser/ruby/legacy/statement_list.rb +20 -11
- data/lib/yard/parser/ruby/ruby_parser.rb +18 -1
- data/lib/yard/parser/source_parser.rb +6 -1
- data/lib/yard/registry.rb +284 -278
- data/lib/yard/registry_store.rb +4 -2
- data/lib/yard/serializers/base.rb +30 -13
- data/lib/yard/serializers/file_system_serializer.rb +10 -1
- data/lib/yard/server/adapter.rb +51 -0
- data/lib/yard/server/commands/base.rb +98 -0
- data/lib/yard/server/commands/display_file_command.rb +20 -0
- data/lib/yard/server/commands/display_object_command.rb +50 -0
- data/lib/yard/server/commands/frames_command.rb +31 -0
- data/lib/yard/server/commands/library_command.rb +83 -0
- data/lib/yard/server/commands/library_index_command.rb +23 -0
- data/lib/yard/server/commands/list_command.rb +44 -0
- data/lib/yard/server/commands/search_command.rb +67 -0
- data/lib/yard/server/commands/static_file_command.rb +45 -0
- data/lib/yard/server/doc_server_helper.rb +22 -0
- data/lib/yard/server/doc_server_serializer.rb +29 -0
- data/lib/yard/server/library_version.rb +86 -0
- data/lib/yard/server/rack_adapter.rb +38 -0
- data/lib/yard/server/router.rb +110 -0
- data/lib/yard/server/static_caching.rb +16 -0
- data/lib/yard/server/templates/default/fulldoc/html/css/custom.css +78 -0
- data/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
- data/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +12 -0
- data/lib/yard/server/templates/default/fulldoc/html/js/live.js +32 -0
- data/lib/yard/server/templates/default/layout/html/breadcrumb.erb +46 -0
- data/lib/yard/server/templates/default/layout/html/headers.erb +11 -0
- data/lib/yard/server/templates/doc_server/frames/html/frames.erb +13 -0
- data/lib/yard/server/templates/doc_server/frames/html/setup.rb +3 -0
- data/lib/yard/server/templates/doc_server/full_list/html/full_list.erb +34 -0
- data/lib/yard/server/templates/doc_server/full_list/html/setup.rb +10 -0
- data/lib/yard/server/templates/doc_server/library_list/html/contents.erb +13 -0
- data/lib/yard/server/templates/doc_server/library_list/html/headers.erb +26 -0
- data/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +12 -0
- data/lib/yard/server/templates/doc_server/library_list/html/setup.rb +3 -0
- data/lib/yard/server/templates/doc_server/library_list/html/title.erb +2 -0
- data/lib/yard/server/templates/doc_server/processing/html/processing.erb +51 -0
- data/lib/yard/server/templates/doc_server/processing/html/setup.rb +3 -0
- data/lib/yard/server/templates/doc_server/search/html/search.erb +19 -0
- data/lib/yard/server/templates/doc_server/search/html/setup.rb +8 -0
- data/lib/yard/server/webrick_adapter.rb +38 -0
- data/lib/yard/tags/default_factory.rb +0 -5
- data/lib/yard/tags/library.rb +61 -22
- data/lib/yard/tags/tag.rb +26 -4
- data/lib/yard/templates/engine.rb +12 -1
- data/lib/yard/templates/erb_cache.rb +2 -1
- data/lib/yard/templates/helpers/base_helper.rb +96 -3
- data/lib/yard/templates/helpers/filter_helper.rb +5 -0
- data/lib/yard/templates/helpers/html_helper.rb +204 -94
- data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +4 -0
- data/lib/yard/templates/helpers/markup_helper.rb +58 -3
- data/lib/yard/templates/helpers/method_helper.rb +7 -0
- data/lib/yard/templates/helpers/module_helper.rb +5 -0
- data/lib/yard/templates/helpers/text_helper.rb +10 -1
- data/lib/yard/templates/helpers/uml_helper.rb +13 -0
- data/lib/yard/templates/section.rb +106 -0
- data/lib/yard/templates/template.rb +20 -19
- data/lib/yard/verifier.rb +21 -2
- data/spec/cli/command_parser_spec.rb +43 -0
- data/spec/cli/diff_spec.rb +170 -0
- data/spec/cli/help_spec.rb +22 -0
- data/spec/cli/server_spec.rb +140 -0
- data/spec/cli/stats_spec.rb +75 -0
- data/spec/cli/yardoc_spec.rb +438 -182
- data/spec/cli/yri_spec.rb +13 -1
- data/spec/code_objects/base_spec.rb +51 -6
- data/spec/code_objects/class_object_spec.rb +15 -1
- data/spec/code_objects/method_object_spec.rb +29 -0
- data/spec/code_objects/namespace_object_spec.rb +150 -129
- data/spec/core_ext/array_spec.rb +4 -23
- data/spec/core_ext/insertion_spec.rb +37 -0
- data/spec/docstring_spec.rb +63 -0
- data/spec/handlers/attribute_handler_spec.rb +4 -0
- data/spec/handlers/base_spec.rb +98 -26
- data/spec/handlers/class_handler_spec.rb +5 -1
- data/spec/handlers/examples/attribute_handler_001.rb.txt +5 -0
- data/spec/handlers/examples/class_handler_001.rb.txt +4 -0
- data/spec/handlers/examples/module_handler_001.rb.txt +6 -1
- data/spec/handlers/examples/visibility_handler_001.rb.txt +4 -0
- data/spec/handlers/method_handler_spec.rb +5 -0
- data/spec/handlers/module_handler_spec.rb +4 -0
- data/spec/handlers/visibility_handler_spec.rb +6 -0
- data/spec/parser/source_parser_spec.rb +24 -0
- data/spec/registry_spec.rb +44 -8
- data/spec/server/adapter_spec.rb +38 -0
- data/spec/server/commands/base_spec.rb +87 -0
- data/spec/server/commands/static_file_command_spec.rb +67 -0
- data/spec/server/doc_server_serializer_spec.rb +58 -0
- data/spec/server/router_spec.rb +115 -0
- data/spec/server/spec_helper.rb +17 -0
- data/spec/server/static_caching_spec.rb +39 -0
- data/spec/server/webrick_servlet_spec.rb +20 -0
- data/spec/templates/constant_spec.rb +40 -0
- data/spec/templates/engine_spec.rb +9 -5
- data/spec/templates/examples/class002.html +1 -3
- data/spec/templates/examples/constant001.txt +25 -0
- data/spec/templates/examples/constant002.txt +7 -0
- data/spec/templates/examples/constant003.txt +11 -0
- data/spec/templates/examples/module001.txt +1 -1
- data/spec/templates/examples/module002.html +319 -0
- data/spec/templates/helpers/base_helper_spec.rb +2 -2
- data/spec/templates/helpers/html_helper_spec.rb +93 -3
- data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +5 -0
- data/spec/templates/helpers/markup_helper_spec.rb +94 -67
- data/spec/templates/helpers/shared_signature_examples.rb +9 -0
- data/spec/templates/helpers/text_helper_spec.rb +12 -0
- data/spec/templates/module_spec.rb +21 -4
- data/spec/templates/section_spec.rb +146 -0
- data/spec/templates/template_spec.rb +9 -20
- data/templates/default/class/setup.rb +5 -5
- data/templates/default/constant/text/header.erb +11 -0
- data/templates/default/constant/text/setup.rb +3 -0
- data/templates/default/fulldoc/html/css/style.css +29 -3
- data/templates/default/fulldoc/html/js/app.js +67 -1
- data/templates/default/fulldoc/html/js/full_list.js +3 -8
- data/templates/default/fulldoc/html/js/jquery.js +150 -15
- data/templates/default/fulldoc/html/setup.rb +9 -0
- data/templates/default/layout/html/footer.erb +1 -1
- data/templates/default/layout/html/setup.rb +7 -25
- data/templates/default/method_details/html/source.erb +1 -1
- data/templates/default/module/html/attribute_summary.erb +2 -2
- data/templates/default/module/html/method_summary.erb +2 -2
- data/templates/default/module/setup.rb +27 -4
- data/templates/default/onefile/html/files.erb +5 -0
- data/templates/default/onefile/html/layout.erb +22 -0
- data/templates/default/onefile/html/readme.erb +3 -0
- data/templates/default/onefile/html/setup.rb +40 -0
- data/templates/default/root/html/setup.rb +1 -0
- data/templates/default/tags/setup.rb +26 -33
- metadata +80 -10
@@ -6,6 +6,7 @@ def init
|
|
6
6
|
options[:readme] = options[:files].first
|
7
7
|
options[:title] ||= "Documentation by YARD #{YARD::VERSION}"
|
8
8
|
|
9
|
+
return serialize_onefile if options[:onefile]
|
9
10
|
generate_assets
|
10
11
|
serialize('_index.html')
|
11
12
|
options[:files].each_with_index do |file, i|
|
@@ -34,6 +35,14 @@ def serialize(object)
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
38
|
+
def serialize_onefile
|
39
|
+
options[:css_data] = file('css/style.css', true) + "\n" + file('css/common.css', true)
|
40
|
+
options[:js_data] = file('js/jquery.js', true) + file('js/app.js', true)
|
41
|
+
Templates::Engine.with_serializer('index.html', options[:serializer]) do
|
42
|
+
T('onefile').run(options)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
37
46
|
def serialize_index(options)
|
38
47
|
Templates::Engine.with_serializer('index.html', options[:serializer]) do
|
39
48
|
T('layout').run(options)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="footer">
|
2
2
|
Generated on <%= Time.now.strftime("%c") %> by
|
3
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
3
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
4
4
|
<%= YARD::VERSION %> (ruby-<%= RUBY_VERSION %>).
|
5
5
|
</div>
|
@@ -1,7 +1,9 @@
|
|
1
1
|
def init
|
2
2
|
@breadcrumb = []
|
3
3
|
|
4
|
-
if @
|
4
|
+
if @onefile
|
5
|
+
sections :layout
|
6
|
+
elsif @file
|
5
7
|
@contents = File.read(@file)
|
6
8
|
@file = File.basename(@file)
|
7
9
|
@fname = @file.gsub(/\.[^.]+$/, '')
|
@@ -37,33 +39,13 @@ end
|
|
37
39
|
|
38
40
|
def index
|
39
41
|
@objects_by_letter = {}
|
40
|
-
objects =
|
42
|
+
objects = Registry.all(:class, :module).sort_by {|o| o.name.to_s }
|
43
|
+
objects = run_verifier(objects)
|
41
44
|
objects.each {|o| (@objects_by_letter[o.name.to_s[0,1].upcase] ||= []) << o }
|
42
45
|
erb(:index)
|
43
46
|
end
|
44
47
|
|
45
48
|
def diskfile
|
46
|
-
|
47
|
-
|
48
|
-
when 'htm', 'html'
|
49
|
-
@contents
|
50
|
-
when 'txt'
|
51
|
-
"<pre>#{@contents}</pre>"
|
52
|
-
when 'textile', 'txtile'
|
53
|
-
htmlify(@contents, :textile)
|
54
|
-
when 'markdown', 'md', 'mdown', 'mkd'
|
55
|
-
htmlify(@contents, :markdown)
|
56
|
-
else
|
57
|
-
htmlify(@contents, diskfile_shebang_or_default)
|
58
|
-
end +
|
59
|
-
"</div>"
|
49
|
+
data = htmlify(markup_file_contents(@contents), markup_for_file(@contents, @file))
|
50
|
+
"<div id='filecontents'>" + data + "</div>"
|
60
51
|
end
|
61
|
-
|
62
|
-
def diskfile_shebang_or_default
|
63
|
-
if @contents =~ /\A#!(\S+)\s*$/ # Shebang support
|
64
|
-
@contents = $'
|
65
|
-
$1.to_sym
|
66
|
-
else
|
67
|
-
options[:markup]
|
68
|
-
end
|
69
|
-
end
|
@@ -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 %>'<% if object.line %>, line <%= object.line %><% end %></span><%= "\n\n" %><%= html_syntax_highlight object.source
|
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 %></pre>
|
8
8
|
</td>
|
9
9
|
</tr>
|
10
10
|
</table>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%
|
2
|
-
<h2><%=
|
1
|
+
<% groups(attr_listing, "Attribute") do |list, name| %>
|
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,7 +1,7 @@
|
|
1
1
|
<% if method_listing.size > 0 %>
|
2
|
-
<%
|
2
|
+
<% groups(method_listing) do |list, name| %>
|
3
3
|
<h2>
|
4
|
-
<%=
|
4
|
+
<%= name %>
|
5
5
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
6
6
|
</h2>
|
7
7
|
|
@@ -88,6 +88,29 @@ def docstring_summary(obj)
|
|
88
88
|
docstring_full(obj).summary
|
89
89
|
end
|
90
90
|
|
91
|
+
def groups(list, type = "Method")
|
92
|
+
if groups_data = object.groups
|
93
|
+
others = list.select {|m| !m.group }
|
94
|
+
groups_data.each do |name|
|
95
|
+
items = list.select {|m| m.group == name }
|
96
|
+
yield(items, name) unless items.empty?
|
97
|
+
end
|
98
|
+
else
|
99
|
+
others = []
|
100
|
+
group_data = {}
|
101
|
+
list.each do |meth|
|
102
|
+
if meth.group
|
103
|
+
(group_data[meth.group] ||= []) << meth
|
104
|
+
else
|
105
|
+
others << meth
|
106
|
+
end
|
107
|
+
end
|
108
|
+
group_data.each {|group, items| yield(items, group) unless items.empty? }
|
109
|
+
end
|
110
|
+
|
111
|
+
scopes(others) {|items, scope| yield(items, "#{scope.to_s.capitalize} #{type} Summary") }
|
112
|
+
end
|
113
|
+
|
91
114
|
def scopes(list)
|
92
115
|
[:class, :instance].each do |scope|
|
93
116
|
items = list.select {|m| m.scope == scope }
|
@@ -96,11 +119,11 @@ def scopes(list)
|
|
96
119
|
end
|
97
120
|
|
98
121
|
def mixed_into(object)
|
99
|
-
unless
|
100
|
-
|
122
|
+
unless globals.mixed_into
|
123
|
+
globals.mixed_into = {}
|
101
124
|
list = run_verifier Registry.all(:class, :module)
|
102
|
-
list.each {|o| o.mixins.each {|m| (
|
125
|
+
list.each {|o| o.mixins.each {|m| (globals.mixed_into[m.path] ||= []) << o } }
|
103
126
|
end
|
104
127
|
|
105
|
-
|
128
|
+
globals.mixed_into[object.path] || []
|
106
129
|
end
|
@@ -0,0 +1,22 @@
|
|
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">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=<%= charset %>" />
|
6
|
+
<title><%= @title %></title>
|
7
|
+
<style type="text/css" media="screen">
|
8
|
+
<%= @css_data %>
|
9
|
+
</style>
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
<%= @js_data %>
|
12
|
+
</script>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<div id="content">
|
16
|
+
<h1><%= @title %></h1>
|
17
|
+
<%= yieldall %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<%= erb(:footer) %>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
include T('default/layout/html')
|
2
|
+
include YARD::Parser::Ruby::Legacy
|
3
|
+
|
4
|
+
def init
|
5
|
+
override_serializer
|
6
|
+
@object = YARD::Registry.root
|
7
|
+
@files.shift
|
8
|
+
@objects.delete(YARD::Registry.root)
|
9
|
+
@objects.unshift(YARD::Registry.root)
|
10
|
+
sections :layout, [:readme, :files, :all_objects]
|
11
|
+
end
|
12
|
+
|
13
|
+
def all_objects
|
14
|
+
@objects.map {|obj| obj.format(options) }.join("\n")
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def read_file(file)
|
20
|
+
File.read(file).force_encoding(charset)
|
21
|
+
end
|
22
|
+
|
23
|
+
def parse_top_comments_from_file
|
24
|
+
data = ""
|
25
|
+
tokens = TokenList.new(read_file(@readme))
|
26
|
+
tokens.each do |token|
|
27
|
+
break unless token.is_a?(RubyToken::TkCOMMENT) || token.is_a?(RubyToken::TkNL)
|
28
|
+
data << (token.text[/\A#\s{0,1}(.*)/, 1] || "\n")
|
29
|
+
end
|
30
|
+
YARD::Docstring.new(data)
|
31
|
+
end
|
32
|
+
|
33
|
+
def override_serializer
|
34
|
+
class << @serializer
|
35
|
+
def serialized_path(object)
|
36
|
+
return object if object.is_a?(String)
|
37
|
+
return 'index.html'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
include T('default/module/html')
|
@@ -1,22 +1,8 @@
|
|
1
1
|
def init
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
def param
|
7
|
-
tag :param
|
8
|
-
end
|
9
|
-
|
10
|
-
def yields
|
11
|
-
tag :yield, :no_names => true
|
12
|
-
end
|
13
|
-
|
14
|
-
def yieldparam
|
15
|
-
tag :yieldparam
|
16
|
-
end
|
17
|
-
|
18
|
-
def yieldreturn
|
19
|
-
tag :yieldreturn, :no_names => true
|
2
|
+
tags = Tags::Library.visible_tags - [:abstract, :deprecated, :note, :todo]
|
3
|
+
create_tag_methods(tags - [:example, :option, :overload, :see])
|
4
|
+
sections :index, tags
|
5
|
+
sections.any(:overload).push(T('docstring'))
|
20
6
|
end
|
21
7
|
|
22
8
|
def return
|
@@ -27,21 +13,7 @@ def return
|
|
27
13
|
tag :return, :no_names => true
|
28
14
|
end
|
29
15
|
|
30
|
-
|
31
|
-
tag :raise, :no_names => true
|
32
|
-
end
|
33
|
-
|
34
|
-
def author
|
35
|
-
tag :author, :no_types => true, :no_names => true
|
36
|
-
end
|
37
|
-
|
38
|
-
def since
|
39
|
-
tag :since, :no_types => true, :no_names => true
|
40
|
-
end
|
41
|
-
|
42
|
-
def version
|
43
|
-
tag :version, :no_types => true, :no_names => true
|
44
|
-
end
|
16
|
+
private
|
45
17
|
|
46
18
|
def tag(name, opts = {})
|
47
19
|
return unless object.has_tag?(name)
|
@@ -52,3 +24,24 @@ def tag(name, opts = {})
|
|
52
24
|
@no_names, @no_types = nil, nil
|
53
25
|
out
|
54
26
|
end
|
27
|
+
|
28
|
+
def create_tag_methods(tags)
|
29
|
+
tags.each do |tag|
|
30
|
+
next if respond_to?(tag)
|
31
|
+
instance_eval(<<-eof, __FILE__, __LINE__ + 1)
|
32
|
+
def #{tag}
|
33
|
+
opts = {:no_types => true, :no_names => true}
|
34
|
+
case Tags::Library.factory_method_for(#{tag.inspect})
|
35
|
+
when :with_types
|
36
|
+
opts[:no_types] = false
|
37
|
+
when :with_types_and_name
|
38
|
+
opts[:no_types] = false
|
39
|
+
opts[:no_names] = false
|
40
|
+
when :with_name
|
41
|
+
opts[:no_names] = false
|
42
|
+
end
|
43
|
+
tag #{tag.inspect}, opts
|
44
|
+
end
|
45
|
+
eof
|
46
|
+
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 27
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
7
|
+
- 6
|
8
|
+
- 0
|
9
|
+
version: 0.6.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Loren Segal
|
@@ -15,16 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-08-29 00:00:00 -04:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|
22
21
|
description: " YARD is a documentation generation tool for the Ruby programming language.\n It enables the user to generate consistent, usable documentation that can be\n exported to a number of formats very easily, and also supports extending for\n custom Ruby constructs such as custom class level definitions.\n"
|
23
22
|
email: lsegal@soen.ca
|
24
23
|
executables:
|
24
|
+
- yard
|
25
25
|
- yardoc
|
26
26
|
- yri
|
27
|
-
- yard-graph
|
28
27
|
extensions: []
|
29
28
|
|
30
29
|
extra_rdoc_files: []
|
@@ -44,13 +43,21 @@ files:
|
|
44
43
|
- docs/Tags.md
|
45
44
|
- docs/Templates.md
|
46
45
|
- docs/WhatsNew.md
|
46
|
+
- bin/yard
|
47
47
|
- bin/yard-graph
|
48
|
+
- bin/yard-server
|
48
49
|
- bin/yardoc
|
49
50
|
- bin/yri
|
50
51
|
- lib/rubygems_plugin.rb
|
51
52
|
- lib/yard/autoload.rb
|
52
|
-
- lib/yard/cli/
|
53
|
-
- lib/yard/cli/
|
53
|
+
- lib/yard/cli/command.rb
|
54
|
+
- lib/yard/cli/command_parser.rb
|
55
|
+
- lib/yard/cli/diff.rb
|
56
|
+
- lib/yard/cli/gems.rb
|
57
|
+
- lib/yard/cli/graph.rb
|
58
|
+
- lib/yard/cli/help.rb
|
59
|
+
- lib/yard/cli/server.rb
|
60
|
+
- lib/yard/cli/stats.rb
|
54
61
|
- lib/yard/cli/yardoc.rb
|
55
62
|
- lib/yard/cli/yri.rb
|
56
63
|
- lib/yard/code_objects/base.rb
|
@@ -66,6 +73,7 @@ files:
|
|
66
73
|
- lib/yard/core_ext/array.rb
|
67
74
|
- lib/yard/core_ext/file.rb
|
68
75
|
- lib/yard/core_ext/hash.rb
|
76
|
+
- lib/yard/core_ext/insertion.rb
|
69
77
|
- lib/yard/core_ext/module.rb
|
70
78
|
- lib/yard/core_ext/string.rb
|
71
79
|
- lib/yard/core_ext/symbol_hash.rb
|
@@ -124,6 +132,42 @@ files:
|
|
124
132
|
- lib/yard/serializers/process_serializer.rb
|
125
133
|
- lib/yard/serializers/stdout_serializer.rb
|
126
134
|
- lib/yard/serializers/yardoc_serializer.rb
|
135
|
+
- lib/yard/server/adapter.rb
|
136
|
+
- lib/yard/server/commands/base.rb
|
137
|
+
- lib/yard/server/commands/display_file_command.rb
|
138
|
+
- lib/yard/server/commands/display_object_command.rb
|
139
|
+
- lib/yard/server/commands/frames_command.rb
|
140
|
+
- lib/yard/server/commands/library_command.rb
|
141
|
+
- lib/yard/server/commands/library_index_command.rb
|
142
|
+
- lib/yard/server/commands/list_command.rb
|
143
|
+
- lib/yard/server/commands/search_command.rb
|
144
|
+
- lib/yard/server/commands/static_file_command.rb
|
145
|
+
- lib/yard/server/doc_server_helper.rb
|
146
|
+
- lib/yard/server/doc_server_serializer.rb
|
147
|
+
- lib/yard/server/library_version.rb
|
148
|
+
- lib/yard/server/rack_adapter.rb
|
149
|
+
- lib/yard/server/router.rb
|
150
|
+
- lib/yard/server/static_caching.rb
|
151
|
+
- lib/yard/server/templates/default/fulldoc/html/css/custom.css
|
152
|
+
- lib/yard/server/templates/default/fulldoc/html/images/processing.gif
|
153
|
+
- lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js
|
154
|
+
- lib/yard/server/templates/default/fulldoc/html/js/live.js
|
155
|
+
- lib/yard/server/templates/default/layout/html/breadcrumb.erb
|
156
|
+
- lib/yard/server/templates/default/layout/html/headers.erb
|
157
|
+
- lib/yard/server/templates/doc_server/frames/html/frames.erb
|
158
|
+
- lib/yard/server/templates/doc_server/frames/html/setup.rb
|
159
|
+
- lib/yard/server/templates/doc_server/full_list/html/full_list.erb
|
160
|
+
- lib/yard/server/templates/doc_server/full_list/html/setup.rb
|
161
|
+
- lib/yard/server/templates/doc_server/library_list/html/contents.erb
|
162
|
+
- lib/yard/server/templates/doc_server/library_list/html/headers.erb
|
163
|
+
- lib/yard/server/templates/doc_server/library_list/html/library_list.erb
|
164
|
+
- lib/yard/server/templates/doc_server/library_list/html/setup.rb
|
165
|
+
- lib/yard/server/templates/doc_server/library_list/html/title.erb
|
166
|
+
- lib/yard/server/templates/doc_server/processing/html/processing.erb
|
167
|
+
- lib/yard/server/templates/doc_server/processing/html/setup.rb
|
168
|
+
- lib/yard/server/templates/doc_server/search/html/search.erb
|
169
|
+
- lib/yard/server/templates/doc_server/search/html/setup.rb
|
170
|
+
- lib/yard/server/webrick_adapter.rb
|
127
171
|
- lib/yard/tags/default_factory.rb
|
128
172
|
- lib/yard/tags/default_tag.rb
|
129
173
|
- lib/yard/tags/library.rb
|
@@ -145,9 +189,15 @@ files:
|
|
145
189
|
- lib/yard/templates/helpers/module_helper.rb
|
146
190
|
- lib/yard/templates/helpers/text_helper.rb
|
147
191
|
- lib/yard/templates/helpers/uml_helper.rb
|
192
|
+
- lib/yard/templates/section.rb
|
148
193
|
- lib/yard/templates/template.rb
|
149
194
|
- lib/yard/verifier.rb
|
150
195
|
- lib/yard.rb
|
196
|
+
- spec/cli/command_parser_spec.rb
|
197
|
+
- spec/cli/diff_spec.rb
|
198
|
+
- spec/cli/help_spec.rb
|
199
|
+
- spec/cli/server_spec.rb
|
200
|
+
- spec/cli/stats_spec.rb
|
151
201
|
- spec/cli/yardoc_spec.rb
|
152
202
|
- spec/cli/yri_spec.rb
|
153
203
|
- spec/code_objects/base_spec.rb
|
@@ -162,6 +212,7 @@ files:
|
|
162
212
|
- spec/core_ext/array_spec.rb
|
163
213
|
- spec/core_ext/file_spec.rb
|
164
214
|
- spec/core_ext/hash_spec.rb
|
215
|
+
- spec/core_ext/insertion_spec.rb
|
165
216
|
- spec/core_ext/module_spec.rb
|
166
217
|
- spec/core_ext/string_spec.rb
|
167
218
|
- spec/core_ext/symbol_hash_spec.rb
|
@@ -227,6 +278,14 @@ files:
|
|
227
278
|
- spec/serializers/file_system_serializer_spec.rb
|
228
279
|
- spec/serializers/spec_helper.rb
|
229
280
|
- spec/serializers/yardoc_serializer_spec.rb
|
281
|
+
- spec/server/adapter_spec.rb
|
282
|
+
- spec/server/commands/base_spec.rb
|
283
|
+
- spec/server/commands/static_file_command_spec.rb
|
284
|
+
- spec/server/doc_server_serializer_spec.rb
|
285
|
+
- spec/server/router_spec.rb
|
286
|
+
- spec/server/spec_helper.rb
|
287
|
+
- spec/server/static_caching_spec.rb
|
288
|
+
- spec/server/webrick_servlet_spec.rb
|
230
289
|
- spec/spec_helper.rb
|
231
290
|
- spec/tags/default_factory_spec.rb
|
232
291
|
- spec/tags/default_tag_spec.rb
|
@@ -234,10 +293,14 @@ files:
|
|
234
293
|
- spec/tags/overload_tag_spec.rb
|
235
294
|
- spec/tags/ref_tag_list_spec.rb
|
236
295
|
- spec/templates/class_spec.rb
|
296
|
+
- spec/templates/constant_spec.rb
|
237
297
|
- spec/templates/engine_spec.rb
|
238
298
|
- spec/templates/examples/class001.html
|
239
299
|
- spec/templates/examples/class001.txt
|
240
300
|
- spec/templates/examples/class002.html
|
301
|
+
- spec/templates/examples/constant001.txt
|
302
|
+
- spec/templates/examples/constant002.txt
|
303
|
+
- spec/templates/examples/constant003.txt
|
241
304
|
- spec/templates/examples/method001.html
|
242
305
|
- spec/templates/examples/method001.txt
|
243
306
|
- spec/templates/examples/method002.html
|
@@ -251,6 +314,7 @@ files:
|
|
251
314
|
- spec/templates/examples/module001.dot
|
252
315
|
- spec/templates/examples/module001.html
|
253
316
|
- spec/templates/examples/module001.txt
|
317
|
+
- spec/templates/examples/module002.html
|
254
318
|
- spec/templates/examples/tag001.txt
|
255
319
|
- spec/templates/helpers/base_helper_spec.rb
|
256
320
|
- spec/templates/helpers/html_helper_spec.rb
|
@@ -261,6 +325,7 @@ files:
|
|
261
325
|
- spec/templates/helpers/text_helper_spec.rb
|
262
326
|
- spec/templates/method_spec.rb
|
263
327
|
- spec/templates/module_spec.rb
|
328
|
+
- spec/templates/section_spec.rb
|
264
329
|
- spec/templates/spec_helper.rb
|
265
330
|
- spec/templates/tag_spec.rb
|
266
331
|
- spec/templates/template_spec.rb
|
@@ -274,6 +339,8 @@ files:
|
|
274
339
|
- templates/default/class/setup.rb
|
275
340
|
- templates/default/class/text/setup.rb
|
276
341
|
- templates/default/class/text/subclasses.erb
|
342
|
+
- templates/default/constant/text/header.erb
|
343
|
+
- templates/default/constant/text/setup.rb
|
277
344
|
- templates/default/docstring/html/abstract.erb
|
278
345
|
- templates/default/docstring/html/deprecated.erb
|
279
346
|
- templates/default/docstring/html/index.erb
|
@@ -349,8 +416,13 @@ files:
|
|
349
416
|
- templates/default/module/text/includes.erb
|
350
417
|
- templates/default/module/text/instance_meths_list.erb
|
351
418
|
- templates/default/module/text/setup.rb
|
419
|
+
- templates/default/onefile/html/files.erb
|
420
|
+
- templates/default/onefile/html/layout.erb
|
421
|
+
- templates/default/onefile/html/readme.erb
|
422
|
+
- templates/default/onefile/html/setup.rb
|
352
423
|
- templates/default/root/dot/child.erb
|
353
424
|
- templates/default/root/dot/setup.rb
|
425
|
+
- templates/default/root/html/setup.rb
|
354
426
|
- templates/default/tags/html/example.erb
|
355
427
|
- templates/default/tags/html/index.erb
|
356
428
|
- templates/default/tags/html/option.erb
|
@@ -399,7 +471,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
399
471
|
requirements:
|
400
472
|
- - ">="
|
401
473
|
- !ruby/object:Gem::Version
|
402
|
-
hash: 3
|
403
474
|
segments:
|
404
475
|
- 0
|
405
476
|
version: "0"
|
@@ -408,7 +479,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
408
479
|
requirements:
|
409
480
|
- - ">="
|
410
481
|
- !ruby/object:Gem::Version
|
411
|
-
hash: 3
|
412
482
|
segments:
|
413
483
|
- 0
|
414
484
|
version: "0"
|