distil 0.14.4 → 0.14.5.a
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/distil +10 -0
- data/lib/distil/project.rb +10 -7
- data/lib/distil/source-file.rb +1 -1
- metadata +28 -164
- data/Buildfile +0 -33
- data/distil.gemspec +0 -783
- data/lib/distil/javascript-documentation-generator.rb +0 -49
- data/vendor/pdoc/LICENSE +0 -16
- data/vendor/pdoc/PDoc.tmbundle/Commands/Continue PDoc Comment.tmCommand +0 -39
- data/vendor/pdoc/PDoc.tmbundle/Macros/Collapse PDoc Blocks.tmMacro +0 -4084
- data/vendor/pdoc/PDoc.tmbundle/Macros/Expand PDoc Blocks.tmMacro +0 -1388
- data/vendor/pdoc/PDoc.tmbundle/Preferences/PDoc.tmPreferences +0 -50
- data/vendor/pdoc/PDoc.tmbundle/Snippets/class.tmSnippet +0 -24
- data/vendor/pdoc/PDoc.tmbundle/Snippets/constant.tmSnippet +0 -22
- data/vendor/pdoc/PDoc.tmbundle/Snippets/event.tmSnippet +0 -16
- data/vendor/pdoc/PDoc.tmbundle/Snippets/method.tmSnippet +0 -22
- data/vendor/pdoc/PDoc.tmbundle/Snippets/mixin.tmSnippet +0 -23
- data/vendor/pdoc/PDoc.tmbundle/Snippets/namespace.tmSnippet +0 -24
- data/vendor/pdoc/PDoc.tmbundle/Snippets/param.tmSnippet +0 -16
- data/vendor/pdoc/PDoc.tmbundle/Snippets/property.tmSnippet +0 -22
- data/vendor/pdoc/PDoc.tmbundle/Snippets/section.tmSnippet +0 -23
- data/vendor/pdoc/PDoc.tmbundle/Syntaxes/PDoc.tmLanguage +0 -33
- data/vendor/pdoc/PDoc.tmbundle/info.plist +0 -22
- data/vendor/pdoc/README.markdown +0 -34
- data/vendor/pdoc/Rakefile +0 -46
- data/vendor/pdoc/bin/pdoc +0 -58
- data/vendor/pdoc/lib/pdoc.rb +0 -32
- data/vendor/pdoc/lib/pdoc/error.rb +0 -4
- data/vendor/pdoc/lib/pdoc/generators.rb +0 -6
- data/vendor/pdoc/lib/pdoc/generators/abstract_generator.rb +0 -16
- data/vendor/pdoc/lib/pdoc/generators/html.rb +0 -8
- data/vendor/pdoc/lib/pdoc/generators/html/helpers.rb +0 -256
- data/vendor/pdoc/lib/pdoc/generators/html/page.rb +0 -71
- data/vendor/pdoc/lib/pdoc/generators/html/syntax_highlighter.rb +0 -41
- data/vendor/pdoc/lib/pdoc/generators/html/template.rb +0 -37
- data/vendor/pdoc/lib/pdoc/generators/html/website.rb +0 -194
- data/vendor/pdoc/lib/pdoc/generators/json.rb +0 -15
- data/vendor/pdoc/lib/pdoc/generators/pythonesque.rb +0 -105
- data/vendor/pdoc/lib/pdoc/models.rb +0 -47
- data/vendor/pdoc/lib/pdoc/models/argument.rb +0 -37
- data/vendor/pdoc/lib/pdoc/models/base.rb +0 -107
- data/vendor/pdoc/lib/pdoc/models/callable.rb +0 -19
- data/vendor/pdoc/lib/pdoc/models/class.rb +0 -28
- data/vendor/pdoc/lib/pdoc/models/class_method.rb +0 -18
- data/vendor/pdoc/lib/pdoc/models/class_property.rb +0 -9
- data/vendor/pdoc/lib/pdoc/models/constant.rb +0 -9
- data/vendor/pdoc/lib/pdoc/models/constructor.rb +0 -14
- data/vendor/pdoc/lib/pdoc/models/container.rb +0 -114
- data/vendor/pdoc/lib/pdoc/models/entity.rb +0 -54
- data/vendor/pdoc/lib/pdoc/models/instance_method.rb +0 -18
- data/vendor/pdoc/lib/pdoc/models/instance_property.rb +0 -9
- data/vendor/pdoc/lib/pdoc/models/mixin.rb +0 -10
- data/vendor/pdoc/lib/pdoc/models/namespace.rb +0 -10
- data/vendor/pdoc/lib/pdoc/models/root.rb +0 -27
- data/vendor/pdoc/lib/pdoc/models/section.rb +0 -19
- data/vendor/pdoc/lib/pdoc/models/signature.rb +0 -27
- data/vendor/pdoc/lib/pdoc/models/utility.rb +0 -11
- data/vendor/pdoc/lib/pdoc/parser.rb +0 -109
- data/vendor/pdoc/lib/pdoc/parser/argument_description_nodes.rb +0 -21
- data/vendor/pdoc/lib/pdoc/parser/basic_nodes.rb +0 -31
- data/vendor/pdoc/lib/pdoc/parser/description_nodes.rb +0 -42
- data/vendor/pdoc/lib/pdoc/parser/documentation_nodes.rb +0 -483
- data/vendor/pdoc/lib/pdoc/parser/ebnf_arguments_nodes.rb +0 -58
- data/vendor/pdoc/lib/pdoc/parser/ebnf_expression_nodes.rb +0 -227
- data/vendor/pdoc/lib/pdoc/parser/fragment.rb +0 -55
- data/vendor/pdoc/lib/pdoc/parser/section_content_nodes.rb +0 -19
- data/vendor/pdoc/lib/pdoc/parser/tags_nodes.rb +0 -14
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/argument_description.treetop +0 -31
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/basic.treetop +0 -41
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/description.treetop +0 -7
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/documentation.treetop +0 -75
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_arguments.treetop +0 -33
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_expression.treetop +0 -70
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_javascript.treetop +0 -54
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/events.treetop +0 -17
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/section_content.treetop +0 -8
- data/vendor/pdoc/lib/pdoc/parser/treetop_files/tags.treetop +0 -31
- data/vendor/pdoc/lib/pdoc/runner.rb +0 -110
- data/vendor/pdoc/lib/pdoc/treemaker.rb +0 -94
- data/vendor/pdoc/pdoc.gemspec +0 -31
- data/vendor/pdoc/templates/html/assets/images/pdoc/alias.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class_deprecated.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class_method.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/class_property.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/constant.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/constructor.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/deprecated.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/description.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/information.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/instance_method.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/instance_property.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/method.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/method_deprecated.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/mixin.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/namespace.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/property.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/related_to.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/search-background.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/section-background.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/section.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/selected-section-background.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/subclass.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/superclass.png +0 -0
- data/vendor/pdoc/templates/html/assets/images/pdoc/utility.png +0 -0
- data/vendor/pdoc/templates/html/assets/javascripts/pdoc/application.js +0 -478
- data/vendor/pdoc/templates/html/assets/javascripts/pdoc/prototype.js +0 -4874
- data/vendor/pdoc/templates/html/assets/javascripts/pdoc/tabs.js +0 -506
- data/vendor/pdoc/templates/html/assets/stylesheets/pdoc/api.css +0 -677
- data/vendor/pdoc/templates/html/assets/stylesheets/pdoc/pygments.css +0 -62
- data/vendor/pdoc/templates/html/helpers.rb +0 -35
- data/vendor/pdoc/templates/html/index.erb +0 -18
- data/vendor/pdoc/templates/html/item_index.js.erb +0 -6
- data/vendor/pdoc/templates/html/layout.erb +0 -67
- data/vendor/pdoc/templates/html/leaf.erb +0 -22
- data/vendor/pdoc/templates/html/node.erb +0 -30
- data/vendor/pdoc/templates/html/partials/class_relationships.erb +0 -19
- data/vendor/pdoc/templates/html/partials/classes.erb +0 -7
- data/vendor/pdoc/templates/html/partials/constructor.erb +0 -5
- data/vendor/pdoc/templates/html/partials/description.erb +0 -5
- data/vendor/pdoc/templates/html/partials/link_list.erb +0 -1
- data/vendor/pdoc/templates/html/partials/method_signatures.erb +0 -14
- data/vendor/pdoc/templates/html/partials/methodized_note.erb +0 -9
- data/vendor/pdoc/templates/html/partials/mixins.erb +0 -7
- data/vendor/pdoc/templates/html/partials/namespaces.erb +0 -7
- data/vendor/pdoc/templates/html/partials/related_utilities.erb +0 -5
- data/vendor/pdoc/templates/html/partials/relationships.erb +0 -11
- data/vendor/pdoc/templates/html/partials/short_description_list.erb +0 -7
- data/vendor/pdoc/templates/html/partials/title.erb +0 -22
- data/vendor/pdoc/templates/html/section.erb +0 -18
- data/vendor/pdoc/test/fixtures/ajax.js +0 -809
- data/vendor/pdoc/test/fixtures/prototype.js +0 -5789
- data/vendor/pdoc/test/fixtures/test.txt +0 -1
- data/vendor/pdoc/test/fixtures/text.txt +0 -13
- data/vendor/pdoc/test/unit/parser/argument_description_test.rb +0 -40
- data/vendor/pdoc/test/unit/parser/basic_test.rb +0 -55
- data/vendor/pdoc/test/unit/parser/description_test.rb +0 -34
- data/vendor/pdoc/test/unit/parser/documentation_test.rb +0 -520
- data/vendor/pdoc/test/unit/parser/ebnf_arguments_test.rb +0 -81
- data/vendor/pdoc/test/unit/parser/ebnf_expression_test.rb +0 -382
- data/vendor/pdoc/test/unit/parser/ebnf_javascript_test.rb +0 -37
- data/vendor/pdoc/test/unit/parser/events_test.rb +0 -27
- data/vendor/pdoc/test/unit/parser/section_content_test.rb +0 -44
- data/vendor/pdoc/test/unit/parser/tags_test.rb +0 -39
- data/vendor/pdoc/test/unit/parser/test_fragment.rb +0 -80
- data/vendor/pdoc/test/unit/parser_test_helper.rb +0 -62
- data/vendor/pdoc/test/unit/runner/basic_test.rb +0 -14
- data/vendor/pdoc/test/unit/templates/html_helpers_test.rb +0 -25
- data/vendor/pdoc/vendor/albino.rb +0 -122
- data/vendor/pdoc/website/html/documentation.html +0 -280
- data/vendor/pdoc/website/html/images/pdoc.jpg +0 -0
- data/vendor/pdoc/website/html/index.html +0 -84
- data/vendor/pdoc/website/html/stylesheets/main.css +0 -73
- data/vendor/pdoc/website/html/stylesheets/reset.css +0 -18
- data/vendor/pdoc/website/markdown/syntax.markdown +0 -226
- data/yuicompressor-2.4.6.zip +0 -0
@@ -1,21 +0,0 @@
|
|
1
|
-
module ArgumentDescription
|
2
|
-
class ArgumentDescription < Treetop::Runtime::SyntaxNode
|
3
|
-
def name
|
4
|
-
first.argument_name.name.text_value
|
5
|
-
end
|
6
|
-
|
7
|
-
def types
|
8
|
-
if first.arg_types.empty?
|
9
|
-
[]
|
10
|
-
else
|
11
|
-
args = first.arg_types.elements.last
|
12
|
-
[args.argument_type.text_value].concat(args.more.elements.map{ |e| e.argument_type.text_value })
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def description
|
17
|
-
more_lines = more.elements.map{ |l| l.to_s.strip }.reject { |l| l.empty? }
|
18
|
-
[first.description.text_value.strip].concat(more_lines).join(" ")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Basic
|
2
|
-
class BlankLine < Treetop::Runtime::SyntaxNode
|
3
|
-
def to_s
|
4
|
-
""
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
class TextLine < Treetop::Runtime::SyntaxNode
|
9
|
-
def to_s
|
10
|
-
text.text_value
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Line < Treetop::Runtime::SyntaxNode
|
15
|
-
end
|
16
|
-
|
17
|
-
class CommentStart < Treetop::Runtime::SyntaxNode
|
18
|
-
end
|
19
|
-
|
20
|
-
class CommentEnd < Treetop::Runtime::SyntaxNode
|
21
|
-
end
|
22
|
-
|
23
|
-
class LineBreak < Treetop::Runtime::SyntaxNode
|
24
|
-
end
|
25
|
-
|
26
|
-
class Char < Treetop::Runtime::SyntaxNode
|
27
|
-
end
|
28
|
-
|
29
|
-
class Space < Treetop::Runtime::SyntaxNode
|
30
|
-
end
|
31
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module Description
|
2
|
-
class Text < Treetop::Runtime::SyntaxNode
|
3
|
-
include Enumerable
|
4
|
-
def each
|
5
|
-
elements.map { |e| e.to_s }.each { |tag| yield tag }
|
6
|
-
end
|
7
|
-
|
8
|
-
def join(sep = "\n")
|
9
|
-
outdent.join(sep).strip
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_s
|
13
|
-
join
|
14
|
-
end
|
15
|
-
|
16
|
-
def excerpt
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
def inspect
|
21
|
-
text = truncate(15).gsub(/\n/, " ").strip.inspect
|
22
|
-
"#<#{self.class} #{text}>"
|
23
|
-
end
|
24
|
-
|
25
|
-
def truncate(num = 30)
|
26
|
-
to_s.length < num ? to_s : to_s.slice(0..num) << "..."
|
27
|
-
end
|
28
|
-
|
29
|
-
def outdent
|
30
|
-
range = tab_length..-1
|
31
|
-
map { |l| l.slice(range) }
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
def tab_length
|
36
|
-
reject { |l| l =~ /^\s*$/ }.map do |line|
|
37
|
-
line = line.slice(/^\s*/)
|
38
|
-
line ? line.length : 0
|
39
|
-
end.min || 0
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,483 +0,0 @@
|
|
1
|
-
module Documentation
|
2
|
-
class Doc < Treetop::Runtime::SyntaxNode
|
3
|
-
include Enumerable
|
4
|
-
|
5
|
-
def tags
|
6
|
-
@tags ||= elements.first.elements.map { |e| e.elements.last }
|
7
|
-
end
|
8
|
-
|
9
|
-
def each
|
10
|
-
tags.each { |tag| yield tag }
|
11
|
-
end
|
12
|
-
|
13
|
-
# find_by_name allows you to search through all the documented instances based on the
|
14
|
-
# instances Base#full_name.
|
15
|
-
# For example:
|
16
|
-
#
|
17
|
-
# PDoc::Parser.new("prototype.js").parse.root.find_by_name("Element#update")
|
18
|
-
#
|
19
|
-
# Return an instance of InstanceMethod corresponding to "Element#update".
|
20
|
-
def find_by_name(name)
|
21
|
-
find { |e| e.full_name == name }
|
22
|
-
end
|
23
|
-
|
24
|
-
def inspect
|
25
|
-
to_a.inspect
|
26
|
-
end
|
27
|
-
|
28
|
-
# Returns the total number of documented instances
|
29
|
-
def size
|
30
|
-
to_a.length
|
31
|
-
end
|
32
|
-
|
33
|
-
def name
|
34
|
-
"Home"
|
35
|
-
end
|
36
|
-
|
37
|
-
def serialize(serializer)
|
38
|
-
each { |obj| obj.serialize(serializer) }
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
module Memoized
|
43
|
-
def method_added(method_name)
|
44
|
-
if instance_method(method_name).arity.zero?
|
45
|
-
avoid_infinite_method_added_loop do
|
46
|
-
memoize(method_name)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def memoize(method_name)
|
52
|
-
sanitized_name = method_name.to_s
|
53
|
-
sanitized_name = sanitized_name.sub(/!$/, '_bang')
|
54
|
-
sanitized_name = sanitized_name.sub(/\?$/, '_question_mark')
|
55
|
-
complete_name = "#{sanitized_name}_#{object_id.abs}"
|
56
|
-
|
57
|
-
class_eval(<<-EVAL, __FILE__, __LINE__)
|
58
|
-
alias compute_#{complete_name} #{method_name} # alias compute_section_12235760 section
|
59
|
-
#
|
60
|
-
def #{method_name} # def section
|
61
|
-
unless defined?(@#{complete_name}) # unless defined?(@section_12235760)
|
62
|
-
@#{complete_name} = compute_#{complete_name} # @section_12235760 = compute_section_12235760
|
63
|
-
end # end
|
64
|
-
@#{complete_name} # @section_12235760
|
65
|
-
end # end
|
66
|
-
EVAL
|
67
|
-
end
|
68
|
-
|
69
|
-
def avoid_infinite_method_added_loop
|
70
|
-
unless @memoizing
|
71
|
-
@memoizing = true
|
72
|
-
yield
|
73
|
-
@memoizing = false
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
class Base < Treetop::Runtime::SyntaxNode
|
79
|
-
extend Memoized
|
80
|
-
|
81
|
-
# Returns an instance of Doc (the root of the tree outputed by the PDoc::Parser).
|
82
|
-
def root
|
83
|
-
parent.parent.parent
|
84
|
-
end
|
85
|
-
|
86
|
-
# True if the instance was tagged as deprecated.
|
87
|
-
def deprecated?
|
88
|
-
tags.include?("deprecated")
|
89
|
-
end
|
90
|
-
|
91
|
-
# If instance is tagged as an alias, alias_of returns the corresponding object.
|
92
|
-
# It will return nil otherwise.
|
93
|
-
def alias_of
|
94
|
-
tag = tags.find { |tag| tag.name == "alias of" }
|
95
|
-
tag.value if tag
|
96
|
-
end
|
97
|
-
|
98
|
-
def related_to
|
99
|
-
tag = tags.find { |tag| tag.name == "related to" }
|
100
|
-
tag.value if tag
|
101
|
-
end
|
102
|
-
|
103
|
-
# Returns an instance of Tags::Tags.
|
104
|
-
def tags
|
105
|
-
start.elements.last.empty? ? [] : start.elements.last
|
106
|
-
end
|
107
|
-
|
108
|
-
# Returns the instance's class name.
|
109
|
-
def klass_name
|
110
|
-
ebnf.klass_name
|
111
|
-
end
|
112
|
-
|
113
|
-
# Returns the instance's name. For example:
|
114
|
-
# root.find_by_name("Element#update").name
|
115
|
-
# # -> "update"
|
116
|
-
def name
|
117
|
-
ebnf.name
|
118
|
-
end
|
119
|
-
|
120
|
-
# Returns the instance's full_name. For example:
|
121
|
-
# root.find_by_name("Element#update").full_name
|
122
|
-
# # -> "Element#update"
|
123
|
-
def full_name
|
124
|
-
ebnf.full_name
|
125
|
-
end
|
126
|
-
|
127
|
-
# Returns the instance's namespace_string. Note that event if the instance is an method or property,
|
128
|
-
# the klass_name is not included in that string. So for example:
|
129
|
-
#
|
130
|
-
# root.find_by_name("Ajax.Request#request").namespace_string
|
131
|
-
# # -> "Ajax"
|
132
|
-
def namespace_string
|
133
|
-
ebnf.namespace
|
134
|
-
end
|
135
|
-
|
136
|
-
# Returns the Klass instance if object is a class, nil otherwise.
|
137
|
-
def klass
|
138
|
-
nil
|
139
|
-
end
|
140
|
-
|
141
|
-
# Returns the instance's closests namespace or nil when instance or instance's
|
142
|
-
# Klass is a global.
|
143
|
-
def namespace
|
144
|
-
@namespace ||= namespace_string.empty? ? nil : root.find_by_name(namespace_string)
|
145
|
-
end
|
146
|
-
|
147
|
-
# If instance is a global, returns its Section. Else its Namespace.
|
148
|
-
def doc_parent
|
149
|
-
namespace ? namespace : section
|
150
|
-
end
|
151
|
-
|
152
|
-
def ebnf_expressions
|
153
|
-
ebnf.elements.map { |e| e.elements.last }
|
154
|
-
end
|
155
|
-
|
156
|
-
def description
|
157
|
-
text.to_s
|
158
|
-
end
|
159
|
-
|
160
|
-
def signature
|
161
|
-
ebnf.text_value.strip
|
162
|
-
end
|
163
|
-
|
164
|
-
def inspect
|
165
|
-
"#<#{self.class} #{full_name}>"
|
166
|
-
end
|
167
|
-
|
168
|
-
def src_code_line
|
169
|
-
input.line_of(interval.last) - 1
|
170
|
-
end
|
171
|
-
|
172
|
-
def parent_id
|
173
|
-
namespace_string.empty? ? section_name : namespace_string
|
174
|
-
end
|
175
|
-
|
176
|
-
def section_name
|
177
|
-
if tags.include?('section')
|
178
|
-
value = tags.find { |tag| tag.name == 'section' }.value
|
179
|
-
"#{value} section"
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
def to_yaml
|
184
|
-
str = "id: #{full_name.inspect}"
|
185
|
-
str << "\nparent_id: #{parent_id.inspect}" if parent_id
|
186
|
-
str << "\ntype: #{type}"
|
187
|
-
str << "\nsuperclass_id: #{superclass.inspect}" if respond_to?(:superclass) && superclass
|
188
|
-
str << "\nincluded: #{mixins.inspect}" if respond_to?(:mixins) && !mixins.empty?
|
189
|
-
str << "\nline_number: #{src_code_line}"
|
190
|
-
str << "\ndeprecated: true" if deprecated?
|
191
|
-
str << "\nalias_of: #{alias_of.inspect}" if respond_to?(:alias_of) && alias_of
|
192
|
-
str << "\nrelated_to: #{related_to.inspect}" if respond_to?(:related_to) && related_to
|
193
|
-
str << "\ndescription: |\n#{indent(description)}\n"
|
194
|
-
end
|
195
|
-
|
196
|
-
def serialize(serializer)
|
197
|
-
serializer << to_yaml
|
198
|
-
end
|
199
|
-
|
200
|
-
private
|
201
|
-
def indent(str, prefix = ' ')
|
202
|
-
str.split($/).map { |line| "#{prefix}#{line}" } * $/
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
class Section < Base
|
207
|
-
# Returns section's name
|
208
|
-
def name
|
209
|
-
section.name
|
210
|
-
end
|
211
|
-
|
212
|
-
# Returns section's full_name
|
213
|
-
def full_name
|
214
|
-
"#{section.name} section"
|
215
|
-
end
|
216
|
-
|
217
|
-
# Returns section's title
|
218
|
-
def title
|
219
|
-
section.title
|
220
|
-
end
|
221
|
-
|
222
|
-
# Returns section's description
|
223
|
-
def description
|
224
|
-
section.description
|
225
|
-
end
|
226
|
-
|
227
|
-
# Returns section's text
|
228
|
-
def text
|
229
|
-
section.text
|
230
|
-
end
|
231
|
-
|
232
|
-
# Returns nil.
|
233
|
-
def klass_name
|
234
|
-
nil
|
235
|
-
end
|
236
|
-
|
237
|
-
# Returns false.
|
238
|
-
def global?
|
239
|
-
false
|
240
|
-
end
|
241
|
-
|
242
|
-
# Returns nil.
|
243
|
-
def namespace
|
244
|
-
nil
|
245
|
-
end
|
246
|
-
|
247
|
-
# Returns an empty string.
|
248
|
-
def namespace_string
|
249
|
-
""
|
250
|
-
end
|
251
|
-
|
252
|
-
# Returns nil.
|
253
|
-
def section
|
254
|
-
nil
|
255
|
-
end
|
256
|
-
|
257
|
-
# Returns nil.
|
258
|
-
def doc_parent
|
259
|
-
nil
|
260
|
-
end
|
261
|
-
|
262
|
-
# Returns "section".
|
263
|
-
def type
|
264
|
-
"section"
|
265
|
-
end
|
266
|
-
end
|
267
|
-
|
268
|
-
class Method < Base
|
269
|
-
def klass
|
270
|
-
namespace
|
271
|
-
end
|
272
|
-
|
273
|
-
def klass_name
|
274
|
-
ebnf_expressions.first.klass_name
|
275
|
-
end
|
276
|
-
|
277
|
-
def full_name
|
278
|
-
ebnf_expressions.first.full_name
|
279
|
-
end
|
280
|
-
|
281
|
-
def name
|
282
|
-
ebnf_expressions.first.name
|
283
|
-
end
|
284
|
-
|
285
|
-
def methodized?
|
286
|
-
ebnf_expressions.first.methodized?
|
287
|
-
end
|
288
|
-
|
289
|
-
def namespace_string
|
290
|
-
ebnf_expressions.first.namespace
|
291
|
-
end
|
292
|
-
|
293
|
-
def arguments
|
294
|
-
args = argument_descriptions.elements
|
295
|
-
args ? args.first.elements : []
|
296
|
-
end
|
297
|
-
|
298
|
-
def signature
|
299
|
-
ebnf_expressions.first.signature
|
300
|
-
end
|
301
|
-
|
302
|
-
def returns
|
303
|
-
ebnf_expressions.first.returns
|
304
|
-
end
|
305
|
-
|
306
|
-
def fires
|
307
|
-
events.empty? ? [] : events.to_a
|
308
|
-
end
|
309
|
-
|
310
|
-
def signatures
|
311
|
-
ebnf_expressions
|
312
|
-
end
|
313
|
-
|
314
|
-
def serialize(serializer)
|
315
|
-
str = to_yaml
|
316
|
-
str << "\nmethodized: true" if respond_to?(:methodized?) && methodized?
|
317
|
-
|
318
|
-
serialize_signatures(str)
|
319
|
-
|
320
|
-
serialize_arguments(str) unless arguments.empty?
|
321
|
-
|
322
|
-
serializer << str
|
323
|
-
end
|
324
|
-
|
325
|
-
def serialize_signatures(str)
|
326
|
-
str << "\nsignatures:"
|
327
|
-
ebnf_expressions.each do |ebnf|
|
328
|
-
str << "\n -"
|
329
|
-
str << "\n signature: #{ebnf.signature.inspect}"
|
330
|
-
str << "\n return_value: #{ebnf.returns.inspect}" if ebnf.returns
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
def serialize_arguments(str)
|
335
|
-
str << "\narguments:"
|
336
|
-
arguments.each do |arg|
|
337
|
-
str << "\n -"
|
338
|
-
str << "\n name: #{arg.name}"
|
339
|
-
str << "\n types: [#{arg.types.join(', ')}]" unless arg.types.empty?
|
340
|
-
str << "\n description: >"
|
341
|
-
str << "\n #{arg.description}\n"
|
342
|
-
end
|
343
|
-
end
|
344
|
-
end
|
345
|
-
|
346
|
-
class Property < Base
|
347
|
-
def klass
|
348
|
-
namespace
|
349
|
-
end
|
350
|
-
|
351
|
-
def signature
|
352
|
-
ebnf.signature
|
353
|
-
end
|
354
|
-
|
355
|
-
def returns
|
356
|
-
ebnf.returns
|
357
|
-
end
|
358
|
-
|
359
|
-
def serialize(serializer)
|
360
|
-
str = to_yaml
|
361
|
-
|
362
|
-
str << "\nsignatures:"
|
363
|
-
str << "\n -"
|
364
|
-
str << "\n signature: #{signature.inspect}"
|
365
|
-
str << "\n return_value: #{returns.inspect}"
|
366
|
-
|
367
|
-
serializer << str
|
368
|
-
end
|
369
|
-
end
|
370
|
-
|
371
|
-
class KlassMethod < Method
|
372
|
-
def klass
|
373
|
-
namespace.is_a?(Klass) ? namespace : nil
|
374
|
-
end
|
375
|
-
|
376
|
-
def klass_name
|
377
|
-
klass ? klass.name : nil
|
378
|
-
end
|
379
|
-
|
380
|
-
def type
|
381
|
-
"class method"
|
382
|
-
end
|
383
|
-
end
|
384
|
-
|
385
|
-
class Utility < Method
|
386
|
-
def type
|
387
|
-
"utility"
|
388
|
-
end
|
389
|
-
end
|
390
|
-
|
391
|
-
class InstanceMethod < Method
|
392
|
-
def type
|
393
|
-
"instance method"
|
394
|
-
end
|
395
|
-
end
|
396
|
-
|
397
|
-
class Constructor < Method
|
398
|
-
def namespace_string
|
399
|
-
ebnf_expressions.first.namespace
|
400
|
-
end
|
401
|
-
|
402
|
-
def type
|
403
|
-
"constructor"
|
404
|
-
end
|
405
|
-
end
|
406
|
-
|
407
|
-
class KlassProperty < Property
|
408
|
-
def type
|
409
|
-
"class property"
|
410
|
-
end
|
411
|
-
end
|
412
|
-
|
413
|
-
class InstanceProperty < Property
|
414
|
-
def type
|
415
|
-
"instance property"
|
416
|
-
end
|
417
|
-
end
|
418
|
-
|
419
|
-
class Constant < Base
|
420
|
-
def klass
|
421
|
-
namespace.is_a?(Klass) ? namespace : nil
|
422
|
-
end
|
423
|
-
|
424
|
-
def klass_name
|
425
|
-
klass ? klass.name : nil
|
426
|
-
end
|
427
|
-
|
428
|
-
def returns
|
429
|
-
ebnf.returns
|
430
|
-
end
|
431
|
-
|
432
|
-
def signature
|
433
|
-
ebnf.signature
|
434
|
-
end
|
435
|
-
|
436
|
-
def type
|
437
|
-
"constant"
|
438
|
-
end
|
439
|
-
end
|
440
|
-
|
441
|
-
class Namespace < Base
|
442
|
-
def mixins
|
443
|
-
ebnf.mixins.map { |m| m.full_name }
|
444
|
-
end
|
445
|
-
|
446
|
-
def mixin?
|
447
|
-
false
|
448
|
-
end
|
449
|
-
|
450
|
-
def klass?
|
451
|
-
false
|
452
|
-
end
|
453
|
-
|
454
|
-
def type
|
455
|
-
"namespace"
|
456
|
-
end
|
457
|
-
end
|
458
|
-
|
459
|
-
class Klass < Namespace
|
460
|
-
def klass?
|
461
|
-
true
|
462
|
-
end
|
463
|
-
|
464
|
-
def superclass
|
465
|
-
sc = ebnf.superklass
|
466
|
-
sc.text_value if sc
|
467
|
-
end
|
468
|
-
|
469
|
-
def type
|
470
|
-
"class"
|
471
|
-
end
|
472
|
-
end
|
473
|
-
|
474
|
-
class Mixin < Namespace
|
475
|
-
def mixin?
|
476
|
-
true
|
477
|
-
end
|
478
|
-
|
479
|
-
def type
|
480
|
-
"mixin"
|
481
|
-
end
|
482
|
-
end
|
483
|
-
end
|