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.
Files changed (157) hide show
  1. data/VERSION +1 -1
  2. data/bin/distil +10 -0
  3. data/lib/distil/project.rb +10 -7
  4. data/lib/distil/source-file.rb +1 -1
  5. metadata +28 -164
  6. data/Buildfile +0 -33
  7. data/distil.gemspec +0 -783
  8. data/lib/distil/javascript-documentation-generator.rb +0 -49
  9. data/vendor/pdoc/LICENSE +0 -16
  10. data/vendor/pdoc/PDoc.tmbundle/Commands/Continue PDoc Comment.tmCommand +0 -39
  11. data/vendor/pdoc/PDoc.tmbundle/Macros/Collapse PDoc Blocks.tmMacro +0 -4084
  12. data/vendor/pdoc/PDoc.tmbundle/Macros/Expand PDoc Blocks.tmMacro +0 -1388
  13. data/vendor/pdoc/PDoc.tmbundle/Preferences/PDoc.tmPreferences +0 -50
  14. data/vendor/pdoc/PDoc.tmbundle/Snippets/class.tmSnippet +0 -24
  15. data/vendor/pdoc/PDoc.tmbundle/Snippets/constant.tmSnippet +0 -22
  16. data/vendor/pdoc/PDoc.tmbundle/Snippets/event.tmSnippet +0 -16
  17. data/vendor/pdoc/PDoc.tmbundle/Snippets/method.tmSnippet +0 -22
  18. data/vendor/pdoc/PDoc.tmbundle/Snippets/mixin.tmSnippet +0 -23
  19. data/vendor/pdoc/PDoc.tmbundle/Snippets/namespace.tmSnippet +0 -24
  20. data/vendor/pdoc/PDoc.tmbundle/Snippets/param.tmSnippet +0 -16
  21. data/vendor/pdoc/PDoc.tmbundle/Snippets/property.tmSnippet +0 -22
  22. data/vendor/pdoc/PDoc.tmbundle/Snippets/section.tmSnippet +0 -23
  23. data/vendor/pdoc/PDoc.tmbundle/Syntaxes/PDoc.tmLanguage +0 -33
  24. data/vendor/pdoc/PDoc.tmbundle/info.plist +0 -22
  25. data/vendor/pdoc/README.markdown +0 -34
  26. data/vendor/pdoc/Rakefile +0 -46
  27. data/vendor/pdoc/bin/pdoc +0 -58
  28. data/vendor/pdoc/lib/pdoc.rb +0 -32
  29. data/vendor/pdoc/lib/pdoc/error.rb +0 -4
  30. data/vendor/pdoc/lib/pdoc/generators.rb +0 -6
  31. data/vendor/pdoc/lib/pdoc/generators/abstract_generator.rb +0 -16
  32. data/vendor/pdoc/lib/pdoc/generators/html.rb +0 -8
  33. data/vendor/pdoc/lib/pdoc/generators/html/helpers.rb +0 -256
  34. data/vendor/pdoc/lib/pdoc/generators/html/page.rb +0 -71
  35. data/vendor/pdoc/lib/pdoc/generators/html/syntax_highlighter.rb +0 -41
  36. data/vendor/pdoc/lib/pdoc/generators/html/template.rb +0 -37
  37. data/vendor/pdoc/lib/pdoc/generators/html/website.rb +0 -194
  38. data/vendor/pdoc/lib/pdoc/generators/json.rb +0 -15
  39. data/vendor/pdoc/lib/pdoc/generators/pythonesque.rb +0 -105
  40. data/vendor/pdoc/lib/pdoc/models.rb +0 -47
  41. data/vendor/pdoc/lib/pdoc/models/argument.rb +0 -37
  42. data/vendor/pdoc/lib/pdoc/models/base.rb +0 -107
  43. data/vendor/pdoc/lib/pdoc/models/callable.rb +0 -19
  44. data/vendor/pdoc/lib/pdoc/models/class.rb +0 -28
  45. data/vendor/pdoc/lib/pdoc/models/class_method.rb +0 -18
  46. data/vendor/pdoc/lib/pdoc/models/class_property.rb +0 -9
  47. data/vendor/pdoc/lib/pdoc/models/constant.rb +0 -9
  48. data/vendor/pdoc/lib/pdoc/models/constructor.rb +0 -14
  49. data/vendor/pdoc/lib/pdoc/models/container.rb +0 -114
  50. data/vendor/pdoc/lib/pdoc/models/entity.rb +0 -54
  51. data/vendor/pdoc/lib/pdoc/models/instance_method.rb +0 -18
  52. data/vendor/pdoc/lib/pdoc/models/instance_property.rb +0 -9
  53. data/vendor/pdoc/lib/pdoc/models/mixin.rb +0 -10
  54. data/vendor/pdoc/lib/pdoc/models/namespace.rb +0 -10
  55. data/vendor/pdoc/lib/pdoc/models/root.rb +0 -27
  56. data/vendor/pdoc/lib/pdoc/models/section.rb +0 -19
  57. data/vendor/pdoc/lib/pdoc/models/signature.rb +0 -27
  58. data/vendor/pdoc/lib/pdoc/models/utility.rb +0 -11
  59. data/vendor/pdoc/lib/pdoc/parser.rb +0 -109
  60. data/vendor/pdoc/lib/pdoc/parser/argument_description_nodes.rb +0 -21
  61. data/vendor/pdoc/lib/pdoc/parser/basic_nodes.rb +0 -31
  62. data/vendor/pdoc/lib/pdoc/parser/description_nodes.rb +0 -42
  63. data/vendor/pdoc/lib/pdoc/parser/documentation_nodes.rb +0 -483
  64. data/vendor/pdoc/lib/pdoc/parser/ebnf_arguments_nodes.rb +0 -58
  65. data/vendor/pdoc/lib/pdoc/parser/ebnf_expression_nodes.rb +0 -227
  66. data/vendor/pdoc/lib/pdoc/parser/fragment.rb +0 -55
  67. data/vendor/pdoc/lib/pdoc/parser/section_content_nodes.rb +0 -19
  68. data/vendor/pdoc/lib/pdoc/parser/tags_nodes.rb +0 -14
  69. data/vendor/pdoc/lib/pdoc/parser/treetop_files/argument_description.treetop +0 -31
  70. data/vendor/pdoc/lib/pdoc/parser/treetop_files/basic.treetop +0 -41
  71. data/vendor/pdoc/lib/pdoc/parser/treetop_files/description.treetop +0 -7
  72. data/vendor/pdoc/lib/pdoc/parser/treetop_files/documentation.treetop +0 -75
  73. data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_arguments.treetop +0 -33
  74. data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_expression.treetop +0 -70
  75. data/vendor/pdoc/lib/pdoc/parser/treetop_files/ebnf_javascript.treetop +0 -54
  76. data/vendor/pdoc/lib/pdoc/parser/treetop_files/events.treetop +0 -17
  77. data/vendor/pdoc/lib/pdoc/parser/treetop_files/section_content.treetop +0 -8
  78. data/vendor/pdoc/lib/pdoc/parser/treetop_files/tags.treetop +0 -31
  79. data/vendor/pdoc/lib/pdoc/runner.rb +0 -110
  80. data/vendor/pdoc/lib/pdoc/treemaker.rb +0 -94
  81. data/vendor/pdoc/pdoc.gemspec +0 -31
  82. data/vendor/pdoc/templates/html/assets/images/pdoc/alias.png +0 -0
  83. data/vendor/pdoc/templates/html/assets/images/pdoc/class.png +0 -0
  84. data/vendor/pdoc/templates/html/assets/images/pdoc/class_deprecated.png +0 -0
  85. data/vendor/pdoc/templates/html/assets/images/pdoc/class_method.png +0 -0
  86. data/vendor/pdoc/templates/html/assets/images/pdoc/class_property.png +0 -0
  87. data/vendor/pdoc/templates/html/assets/images/pdoc/constant.png +0 -0
  88. data/vendor/pdoc/templates/html/assets/images/pdoc/constructor.png +0 -0
  89. data/vendor/pdoc/templates/html/assets/images/pdoc/deprecated.png +0 -0
  90. data/vendor/pdoc/templates/html/assets/images/pdoc/description.png +0 -0
  91. data/vendor/pdoc/templates/html/assets/images/pdoc/information.png +0 -0
  92. data/vendor/pdoc/templates/html/assets/images/pdoc/instance_method.png +0 -0
  93. data/vendor/pdoc/templates/html/assets/images/pdoc/instance_property.png +0 -0
  94. data/vendor/pdoc/templates/html/assets/images/pdoc/method.png +0 -0
  95. data/vendor/pdoc/templates/html/assets/images/pdoc/method_deprecated.png +0 -0
  96. data/vendor/pdoc/templates/html/assets/images/pdoc/mixin.png +0 -0
  97. data/vendor/pdoc/templates/html/assets/images/pdoc/namespace.png +0 -0
  98. data/vendor/pdoc/templates/html/assets/images/pdoc/property.png +0 -0
  99. data/vendor/pdoc/templates/html/assets/images/pdoc/related_to.png +0 -0
  100. data/vendor/pdoc/templates/html/assets/images/pdoc/search-background.png +0 -0
  101. data/vendor/pdoc/templates/html/assets/images/pdoc/section-background.png +0 -0
  102. data/vendor/pdoc/templates/html/assets/images/pdoc/section.png +0 -0
  103. data/vendor/pdoc/templates/html/assets/images/pdoc/selected-section-background.png +0 -0
  104. data/vendor/pdoc/templates/html/assets/images/pdoc/subclass.png +0 -0
  105. data/vendor/pdoc/templates/html/assets/images/pdoc/superclass.png +0 -0
  106. data/vendor/pdoc/templates/html/assets/images/pdoc/utility.png +0 -0
  107. data/vendor/pdoc/templates/html/assets/javascripts/pdoc/application.js +0 -478
  108. data/vendor/pdoc/templates/html/assets/javascripts/pdoc/prototype.js +0 -4874
  109. data/vendor/pdoc/templates/html/assets/javascripts/pdoc/tabs.js +0 -506
  110. data/vendor/pdoc/templates/html/assets/stylesheets/pdoc/api.css +0 -677
  111. data/vendor/pdoc/templates/html/assets/stylesheets/pdoc/pygments.css +0 -62
  112. data/vendor/pdoc/templates/html/helpers.rb +0 -35
  113. data/vendor/pdoc/templates/html/index.erb +0 -18
  114. data/vendor/pdoc/templates/html/item_index.js.erb +0 -6
  115. data/vendor/pdoc/templates/html/layout.erb +0 -67
  116. data/vendor/pdoc/templates/html/leaf.erb +0 -22
  117. data/vendor/pdoc/templates/html/node.erb +0 -30
  118. data/vendor/pdoc/templates/html/partials/class_relationships.erb +0 -19
  119. data/vendor/pdoc/templates/html/partials/classes.erb +0 -7
  120. data/vendor/pdoc/templates/html/partials/constructor.erb +0 -5
  121. data/vendor/pdoc/templates/html/partials/description.erb +0 -5
  122. data/vendor/pdoc/templates/html/partials/link_list.erb +0 -1
  123. data/vendor/pdoc/templates/html/partials/method_signatures.erb +0 -14
  124. data/vendor/pdoc/templates/html/partials/methodized_note.erb +0 -9
  125. data/vendor/pdoc/templates/html/partials/mixins.erb +0 -7
  126. data/vendor/pdoc/templates/html/partials/namespaces.erb +0 -7
  127. data/vendor/pdoc/templates/html/partials/related_utilities.erb +0 -5
  128. data/vendor/pdoc/templates/html/partials/relationships.erb +0 -11
  129. data/vendor/pdoc/templates/html/partials/short_description_list.erb +0 -7
  130. data/vendor/pdoc/templates/html/partials/title.erb +0 -22
  131. data/vendor/pdoc/templates/html/section.erb +0 -18
  132. data/vendor/pdoc/test/fixtures/ajax.js +0 -809
  133. data/vendor/pdoc/test/fixtures/prototype.js +0 -5789
  134. data/vendor/pdoc/test/fixtures/test.txt +0 -1
  135. data/vendor/pdoc/test/fixtures/text.txt +0 -13
  136. data/vendor/pdoc/test/unit/parser/argument_description_test.rb +0 -40
  137. data/vendor/pdoc/test/unit/parser/basic_test.rb +0 -55
  138. data/vendor/pdoc/test/unit/parser/description_test.rb +0 -34
  139. data/vendor/pdoc/test/unit/parser/documentation_test.rb +0 -520
  140. data/vendor/pdoc/test/unit/parser/ebnf_arguments_test.rb +0 -81
  141. data/vendor/pdoc/test/unit/parser/ebnf_expression_test.rb +0 -382
  142. data/vendor/pdoc/test/unit/parser/ebnf_javascript_test.rb +0 -37
  143. data/vendor/pdoc/test/unit/parser/events_test.rb +0 -27
  144. data/vendor/pdoc/test/unit/parser/section_content_test.rb +0 -44
  145. data/vendor/pdoc/test/unit/parser/tags_test.rb +0 -39
  146. data/vendor/pdoc/test/unit/parser/test_fragment.rb +0 -80
  147. data/vendor/pdoc/test/unit/parser_test_helper.rb +0 -62
  148. data/vendor/pdoc/test/unit/runner/basic_test.rb +0 -14
  149. data/vendor/pdoc/test/unit/templates/html_helpers_test.rb +0 -25
  150. data/vendor/pdoc/vendor/albino.rb +0 -122
  151. data/vendor/pdoc/website/html/documentation.html +0 -280
  152. data/vendor/pdoc/website/html/images/pdoc.jpg +0 -0
  153. data/vendor/pdoc/website/html/index.html +0 -84
  154. data/vendor/pdoc/website/html/stylesheets/main.css +0 -73
  155. data/vendor/pdoc/website/html/stylesheets/reset.css +0 -18
  156. data/vendor/pdoc/website/markdown/syntax.markdown +0 -226
  157. data/yuicompressor-2.4.6.zip +0 -0
@@ -1 +0,0 @@
1
- *
@@ -1,13 +0,0 @@
1
-
2
- * some text
3
- * more text
4
- *
5
- * function foo() {
6
- * return blah
7
- * }
8
- *
9
- * some more text.
10
- *
11
- * Lorem ipsum dolor sit amet, consectetur adipisicing elit,
12
- * sed do eiusmod tempor incididunt ut labore et dolore magna
13
- * aliqua.
@@ -1,40 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))
2
-
3
- class ArgumentDescriptionTest < Test::Unit::TestCase
4
- include PDocTestHelper
5
- include Basic
6
- include ArgumentDescription
7
-
8
- def setup
9
- @parser = ArgumentDescriptionParser.new
10
- end
11
-
12
- def test_argument_with_no_type
13
- fixture = parse("\n * - foo: a definition#{blank_line}")
14
- assert_equal "foo", fixture.name
15
- assert_equal [], fixture.types
16
- assert_equal "a definition", fixture.description
17
-
18
- fixture = parse("\n * - @foo: a definition#{blank_line}")
19
- assert_equal "foo", fixture.name
20
- assert_equal [], fixture.types
21
- assert_equal "a definition", fixture.description
22
-
23
- fixture = parse("\n * - foo: a rather long definition \n* that extends to a second line. #{blank_line}")
24
- assert_equal "a rather long definition that extends to a second line.", fixture.description
25
- end
26
-
27
- def test_argument_with_single_type
28
- fixture = parse("\n * - foo (String): a definition#{blank_line}")
29
- assert_equal "foo", fixture.name
30
- assert_equal %w[String], fixture.types
31
- end
32
-
33
- def test_argument_with_multiple_types
34
- fixture = parse("\n * - foo (String | Number): a definition#{blank_line}")
35
- assert_equal "foo", fixture.name
36
- assert_equal %w[String Number], fixture.types
37
- fixture = parse("\n * - foo (String | Number | Object): a definition#{blank_line}")
38
- assert_equal %w[String Number Object], fixture.types
39
- end
40
- end
@@ -1,55 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))
2
-
3
- class BasicTest < Test::Unit::TestCase
4
- include PDocTestHelper
5
- include Basic
6
-
7
- def setup
8
- @parser = BasicParser.new
9
- end
10
-
11
- def test_fixture_loader
12
- assert_file_parsed "test.txt"
13
- end
14
-
15
- def test_space
16
- assert_parsed " "
17
- assert_equal Space, parse(" ").elements.first.class
18
- end
19
-
20
- def test_text_line
21
- text_line = "\n * here's some text "
22
- assert_parsed text_line
23
- assert_equal TextLine, parse(text_line).elements.first.class
24
- assert_equal "here's some text", parse(text_line).elements.first.to_s.strip
25
- end
26
-
27
- def test_line_break
28
- assert_parsed "\n"
29
- assert_equal LineBreak, parse("\n").elements.first.class
30
- end
31
-
32
- def test_blank_line
33
- blank_line = "\n * \n"
34
- assert_parsed blank_line
35
- assert_equal BlankLine, parse(blank_line).elements.first.class
36
- assert_equal "", parse(blank_line).elements.first.to_s
37
-
38
- empty = "\n *\n"
39
- assert_parsed empty
40
- assert_equal BlankLine, parse(empty).elements.first.class
41
- assert_equal "", parse(empty).elements.first.to_s
42
- end
43
-
44
- def test_comment_start
45
- starts = "\n /** "
46
- assert_parsed starts
47
- assert_equal CommentStart, parse(starts).elements.first.class
48
- end
49
-
50
- def test_comment_end
51
- ends = "\n **/ \n"
52
- assert_parsed ends
53
- assert_equal CommentEnd, parse(ends).elements.first.class
54
- end
55
- end
@@ -1,34 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))
2
-
3
- class DescriptionTest < Test::Unit::TestCase
4
- include PDocTestHelper
5
- include Basic
6
- include Description
7
-
8
- def setup
9
- @parser = DescriptionParser.new
10
- end
11
-
12
- def test_parsing
13
- assert_parsed ""
14
- assert_parsed "\n * hello"
15
- assert_parsed "\n * \n * hello"
16
- assert_file_parsed "text.txt"
17
- end
18
-
19
- def test_description
20
- fixture = parse_file("text.txt")
21
- assert_equal String, fixture.to_s.class
22
- assert_equal "some text", fixture.to_a.first
23
- assert_equal "aliqua.", fixture.to_a.last
24
- end
25
-
26
- def test_truncate
27
- assert_equal "some text...", parse_file("text.txt").truncate(8)
28
- assert_equal "some text", parse("\n * some text").truncate()
29
- end
30
-
31
- def test_inspect
32
- assert_equal "#<Description::Text \"some text more t...\">", parse_file("text.txt").inspect
33
- end
34
- end
@@ -1,520 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))
2
-
3
- class DocumentationTest < Test::Unit::TestCase
4
- include PDocTestHelper
5
- include Documentation
6
- @@fixtures = nil
7
-
8
- def setup
9
- @parser = DocumentationParser.new
10
- end
11
-
12
- def fixtures
13
- @@fixtures ||= parse_file("ajax.js") # rather hacky, I know.
14
- end
15
-
16
- def test_listing_methods
17
- %w(klass_methods instance_methods constructors constants
18
- descendants globals klass_properties instance_properties utilities
19
- klasses).each do |method|
20
- assert_respond_to fixtures, method
21
- end
22
- assert_equal 34, fixtures.size
23
- end
24
-
25
- def test_globals
26
- assert_equal %w[$ $$ Ajax Element Enumerable String Toggle], fixtures.globals.map(&:name).sort
27
- end
28
-
29
- def test_descendants
30
- assert_equal %w[$ $$ Ajax Base Element Enumerable Manager Request Responders String Toggle],
31
- fixtures.descendants.map(&:name).sort
32
- end
33
-
34
- def test_mixins
35
- assert_equal %w[Enumerable], fixtures.mixins.map(&:name)
36
- end
37
-
38
- def test_sections
39
- assert_equal %w[DOM ajax lang], fixtures.sections.map(&:name)
40
- assert_equal [Section, Section, Section], fixtures.sections.map(&:class)
41
- assert_equal %w[Ajax], fixtures.sections[1].children.map(&:name)
42
- assert_equal %w[Ajax Base Manager Request Responders], fixtures.sections[1].descendants.map(&:name)
43
- end
44
-
45
- def test_find_by_name
46
- assert_equal "Ajax", fixtures.find_by_name("Ajax").name
47
- assert_equal "Responders", fixtures.find_by_name("Ajax.Responders").name
48
- assert_equal nil, fixtures.find_by_name("Foo.bar")
49
- end
50
-
51
- def test_root
52
- assert_equal Doc, fixtures.find_by_name("Ajax").root.class
53
- end
54
-
55
- def test_namespace
56
- fixture = fixtures.find_by_name("Ajax")
57
- assert_equal Namespace, fixture.class
58
- assert_equal [], fixture.mixins
59
- assert_equal "Ajax", fixture.name
60
- assert_equal "ajax", fixture.section.name
61
- assert_equal "", fixture.namespace_string
62
- assert_equal nil, fixture.namespace
63
- assert !fixture.deprecated?
64
- assert !fixture.alias?
65
- assert_equal %w[__private__ getTransport], fixture.klass_methods.map(&:name)
66
- assert_equal %w[activeRequestCount], fixture.klass_properties.map(&:name)
67
- assert_equal [], fixture.instance_methods
68
- assert_equal [], fixture.instance_properties
69
- assert_equal [], fixture.related_utilities
70
- assert_equal "ajax", fixture.doc_parent.name
71
- assert_equal %w[ajax], fixture.ancestors.map(&:name)
72
- assert_equal %w[Base Request Responders], fixture.children.map(&:name)
73
- assert_equal %w[Base Request Responders], fixture.descendants.map(&:name)
74
-
75
- fixture = fixtures.find_by_name("Ajax.Responders")
76
- assert_equal Namespace, fixture.class
77
- assert !fixture.mixin?
78
- assert_equal ["Enumerable"], fixture.mixins.map(&:name)
79
- assert_equal [Mixin], fixture.mixins.map(&:class)
80
- assert_equal "Responders", fixture.name
81
- assert_equal "ajax", fixture.section.name
82
- assert_equal "Ajax", fixture.namespace_string
83
- assert_equal "Ajax", fixture.namespace.full_name
84
- assert !fixture.deprecated?
85
- assert !fixture.alias?
86
- assert_equal "Ajax", fixture.doc_parent.name
87
- assert_equal %w[Ajax ajax], fixture.ancestors.map(&:name)
88
- assert_equal [], fixture.children
89
- assert_equal [], fixture.descendants
90
- end
91
-
92
- def test_mixin
93
- fixture = fixtures.find_by_name("Enumerable")
94
- assert_equal Mixin, fixture.class
95
- assert fixture.mixin?
96
- assert_equal "Enumerable", fixture.name
97
- assert_equal "lang", fixture.section.name
98
- assert_equal "", fixture.namespace_string
99
- assert_equal nil, fixture.namespace
100
- assert_equal [], fixture.klass_methods
101
- assert_equal [], fixture.klass_properties
102
- assert_equal ["each"], fixture.instance_methods.map(&:name)
103
- assert_equal [], fixture.instance_properties
104
- assert_equal [], fixture.related_utilities
105
- assert_equal "lang", fixture.doc_parent.name
106
- assert_equal %w[lang], fixture.ancestors.map(&:name)
107
- assert_equal [], fixture.children
108
- assert_equal [], fixture.descendants
109
- end
110
-
111
- def test_klass
112
- fixture = fixtures.find_by_name("Ajax.Base")
113
- assert_equal Klass, fixture.class
114
- assert_equal "Base", fixture.name
115
- assert_equal "Ajax", fixture.namespace_string
116
- assert_equal "Ajax.Base", fixture.full_name
117
- assert_equal [], fixture.mixins
118
- assert_equal %w[Request], fixture.subklasses.map(&:name)
119
- assert !fixture.mixin?
120
- assert !fixture.subklass?
121
- assert_equal nil, fixture.superklass
122
- assert fixture.superklass?
123
- assert_equal "ajax", fixture.section.name
124
- assert_equal "Ajax", fixture.namespace.full_name
125
- assert !fixture.deprecated?
126
- assert !fixture.alias?
127
- assert_equal [], fixture.klass_methods
128
- assert_equal [], fixture.methodized_methods
129
- assert_equal [], fixture.klass_properties
130
- assert_equal [], fixture.instance_methods
131
- assert_equal [], fixture.instance_properties
132
- assert_equal [], fixture.related_utilities
133
- assert_equal "Ajax", fixture.doc_parent.name
134
- assert_equal %w[Ajax ajax], fixture.ancestors.map(&:name)
135
- assert_equal [], fixture.children
136
- assert_equal [], fixture.descendants
137
-
138
- fixture = fixtures.find_by_name("Ajax.Request")
139
- assert_equal Klass, fixture.class
140
- assert_equal "Request", fixture.name
141
- assert_equal "Ajax", fixture.namespace_string
142
- assert_equal "Ajax.Request", fixture.full_name
143
- assert_equal fixtures.find_by_name("new Ajax.Request"), fixture.constructor
144
- assert_equal [], fixture.mixins
145
- assert_equal [], fixture.subklasses
146
- assert !fixture.mixin?
147
- assert fixture.subklass?
148
- assert !fixture.superklass?
149
- assert_equal "Ajax.Base", fixture.superklass.full_name
150
- assert_equal Klass, fixture.superklass.class
151
- assert_equal "ajax", fixture.section.name
152
- assert_equal "Ajax", fixture.namespace.full_name
153
- assert !fixture.deprecated?
154
- assert !fixture.alias?
155
- assert_equal [], fixture.klass_methods
156
- assert_equal [], fixture.methodized_methods
157
- assert_equal %w[classProp], fixture.klass_properties.map(&:name)
158
- assert_equal %w[request success], fixture.instance_methods.map(&:name)
159
- assert_equal %w[dummy], fixture.instance_properties.map(&:name)
160
- assert_equal %w[Events], fixture.constants.map(&:name)
161
- assert_equal [], fixture.related_utilities
162
- assert_equal "Ajax", fixture.doc_parent.name
163
- assert_equal %w[Ajax ajax], fixture.ancestors.map(&:name)
164
- assert_equal [], fixture.children
165
- assert_equal [], fixture.descendants
166
-
167
- fixture = fixtures.find_by_name("Element")
168
- assert_equal Klass, fixture.class
169
- assert_equal %w[setStyle], fixture.klass_methods.map(&:name)
170
- assert_equal %w[setStyle], fixture.methodized_methods.map(&:name)
171
- assert_equal [], fixture.klass_properties
172
- assert_equal %w[bar foo], fixture.instance_methods.map(&:name)
173
- assert_equal [], fixture.instance_properties
174
- assert_equal %w[$], fixture.related_utilities.map(&:name)
175
- assert_equal "DOM", fixture.doc_parent.name
176
- assert_equal %w[DOM], fixture.ancestors.map(&:name)
177
- assert_equal [], fixture.children
178
- assert_equal [], fixture.descendants
179
-
180
- fixture = fixtures.find_by_name("String")
181
- assert_equal Klass, fixture.class
182
- assert_equal %w[interpret], fixture.klass_methods.map(&:name)
183
- end
184
-
185
- def test_klass_method
186
- fixture = fixtures.find_by_name("String.interpret")
187
- assert_equal KlassMethod, fixture.class
188
- assert_equal "interpret", fixture.name
189
- assert_equal "String", fixture.namespace_string
190
- assert_equal "String.interpret", fixture.full_name
191
- assert_equal "String", fixture.klass_name
192
- assert_equal Klass, fixture.klass.class
193
- assert_equal "String", fixture.klass.full_name
194
- assert_equal "lang", fixture.section.name
195
- assert_equal Klass, fixture.namespace.class
196
- assert_equal "String", fixture.namespace.full_name
197
- assert !fixture.deprecated?
198
- assert !fixture.alias?
199
- assert_equal "String", fixture.doc_parent.name
200
- assert_equal %w[String lang], fixture.ancestors.map(&:name)
201
- assert_equal [], fixture.children
202
- assert_equal [], fixture.descendants
203
-
204
- fixture = fixtures.find_by_name("Ajax.getTransport")
205
- assert_equal KlassMethod, fixture.class
206
- assert_equal "getTransport", fixture.name
207
- assert_equal "Ajax", fixture.namespace_string
208
- assert_equal "Ajax.getTransport", fixture.full_name
209
- assert_equal nil, fixture.klass_name
210
- assert_equal "ajax", fixture.section.name
211
- assert_equal Namespace, fixture.namespace.class
212
- assert_equal "Ajax", fixture.namespace.full_name
213
- assert !fixture.deprecated?
214
- assert !fixture.alias?
215
- assert_equal "Ajax", fixture.doc_parent.name
216
- assert_equal %w[Ajax ajax], fixture.ancestors.map(&:name)
217
- assert_equal [], fixture.children
218
- assert_equal [], fixture.descendants
219
- end
220
-
221
- def test_klass_properties
222
- fixture = fixtures.find_by_name("Ajax.Request.classProp")
223
- assert_equal KlassProperty, fixture.class
224
- assert_equal "classProp", fixture.name
225
- assert_equal "Ajax.Request", fixture.namespace_string
226
- assert_equal "Ajax.Request.classProp", fixture.full_name
227
- assert_equal "Request", fixture.klass_name
228
- assert_equal Klass, fixture.klass.class
229
- assert_equal "Ajax.Request", fixture.klass.full_name
230
- assert_equal "ajax", fixture.section.name
231
- assert_equal Klass, fixture.namespace.class
232
- assert_equal "Ajax.Request", fixture.namespace.full_name
233
- assert !fixture.deprecated?
234
- assert !fixture.alias?
235
- assert_equal "Request", fixture.doc_parent.name
236
- assert_equal %w[Request Ajax ajax], fixture.ancestors.map(&:name)
237
- assert_equal [], fixture.children
238
- assert_equal [], fixture.descendants
239
- end
240
-
241
- def test_utilities
242
- fixture = fixtures.find_by_name("$")
243
- assert_equal Utility, fixture.class
244
- assert_equal "$", fixture.name
245
- assert_equal "", fixture.namespace_string
246
- assert_equal "$", fixture.full_name
247
- assert_equal nil, fixture.klass_name
248
- assert_equal "DOM", fixture.section.name
249
- assert_equal fixtures.find_by_name("Element"), fixture.related_to
250
- assert_equal nil, fixture.namespace
251
- assert !fixture.deprecated?
252
- assert !fixture.alias?
253
- assert_equal "DOM", fixture.doc_parent.name
254
- assert_equal %w[DOM], fixture.ancestors.map(&:name)
255
- assert_equal [], fixture.children
256
- assert_equal [], fixture.descendants
257
-
258
- fixture = fixtures.find_by_name("$$")
259
- assert_equal Utility, fixture.class
260
- assert_equal "DOM", fixture.section.name
261
- assert_equal nil, fixture.related_to
262
- end
263
-
264
- def test_constants
265
- fixture = fixtures.find_by_name("Ajax.Request.Events")
266
- assert_equal Constant, fixture.class
267
- assert_equal Klass, fixture.namespace.class
268
- assert_equal "Events", fixture.name
269
- assert_equal "Ajax.Request", fixture.namespace_string
270
- assert_equal "Ajax.Request.Events", fixture.full_name
271
- assert_equal "Request", fixture.klass_name
272
- assert_equal Klass, fixture.klass.class
273
- assert_equal "Ajax.Request", fixture.klass.full_name
274
- assert_equal "ajax", fixture.section.name
275
- assert_equal Klass, fixture.namespace.class
276
- assert_equal "Ajax.Request", fixture.namespace.full_name
277
- assert !fixture.deprecated?
278
- assert !fixture.alias?
279
- assert_equal "Request", fixture.doc_parent.name
280
- assert_equal %w[Request Ajax ajax], fixture.ancestors.map(&:name)
281
- assert_equal [], fixture.children
282
- assert_equal [], fixture.descendants
283
-
284
- fixture = fixtures.find_by_name("Ajax.Request.classProp")
285
- assert_equal KlassProperty, fixture.class
286
- assert_equal "classProp", fixture.name
287
- assert_equal "Ajax.Request", fixture.namespace_string
288
- assert_equal "Ajax.Request.classProp", fixture.full_name
289
- assert_equal "Request", fixture.klass_name
290
- assert_equal Klass, fixture.klass.class
291
- assert_equal "Ajax.Request", fixture.klass.full_name
292
- assert_equal "ajax", fixture.section.name
293
- assert_equal Klass, fixture.namespace.class
294
- assert_equal "Ajax.Request", fixture.namespace.full_name
295
- assert !fixture.deprecated?
296
- assert !fixture.alias?
297
- assert_equal "Request", fixture.doc_parent.name
298
- assert_equal %w[Request Ajax ajax], fixture.ancestors.map(&:name)
299
- assert_equal [], fixture.children
300
- assert_equal [], fixture.descendants
301
- end
302
-
303
- def test_instance_properties
304
- fixture = fixtures.find_by_name("Ajax.Request#dummy")
305
- assert_equal InstanceProperty, fixture.class
306
- assert_equal "dummy", fixture.name
307
- assert_equal "Ajax.Request", fixture.namespace_string
308
- assert_equal "Ajax.Request#dummy", fixture.full_name
309
- assert_equal "Request", fixture.klass_name
310
- assert_equal Klass, fixture.klass.class
311
- assert_equal "Ajax.Request", fixture.klass.full_name
312
- assert_equal "ajax", fixture.section.name
313
- assert_equal Klass, fixture.namespace.class
314
- assert_equal "Ajax.Request", fixture.namespace.full_name
315
- assert !fixture.deprecated?
316
- assert !fixture.alias?
317
- assert_equal "Request", fixture.doc_parent.name
318
- assert_equal %w[Request Ajax ajax], fixture.ancestors.map(&:name)
319
- assert_equal [], fixture.children
320
- assert_equal [], fixture.descendants
321
- end
322
-
323
- def test_instance_method
324
- fixture = fixtures.find_by_name("Ajax.Request#request")
325
- assert_equal InstanceMethod, fixture.class
326
- assert_equal "request", fixture.name
327
- assert_equal "Ajax.Request", fixture.namespace_string
328
- assert_equal "Ajax.Request#request", fixture.full_name
329
- assert_equal "Request", fixture.klass_name
330
- assert_equal Klass, fixture.klass.class
331
- assert_equal "Ajax.Request", fixture.klass.full_name
332
- assert_equal "ajax", fixture.section.name
333
- assert_equal Klass, fixture.namespace.class
334
- assert_equal "Ajax.Request", fixture.namespace.full_name
335
- assert !fixture.deprecated?
336
- assert !fixture.alias?
337
- assert !fixture.methodized?
338
- assert_equal "Request", fixture.doc_parent.name
339
- assert_equal %w[Request Ajax ajax], fixture.ancestors.map(&:name)
340
- assert_equal [], fixture.children
341
- assert_equal [], fixture.descendants
342
-
343
- fixture = fixtures.find_by_name("Element.setStyle")
344
- assert_equal KlassMethod, fixture.class
345
- assert_equal "setStyle", fixture.name
346
- assert_equal "Element", fixture.namespace_string
347
- assert_equal "Element.setStyle", fixture.full_name
348
- assert_equal "Element", fixture.klass_name
349
- assert_equal Klass, fixture.klass.class
350
- assert_equal "Element", fixture.klass.full_name
351
- assert_equal "DOM", fixture.section.name
352
- assert_equal Klass, fixture.namespace.class
353
- assert_equal "Element", fixture.namespace.full_name
354
- assert !fixture.deprecated?
355
- assert !fixture.alias?
356
- assert fixture.methodized?
357
- assert_equal "Element", fixture.doc_parent.name
358
- assert_equal %w[Element DOM], fixture.ancestors.map(&:name)
359
- assert_equal [], fixture.children
360
- assert_equal [], fixture.descendants
361
- end
362
-
363
- def test_constructor
364
- fixture = fixtures.find_by_name("new Ajax.Request")
365
- assert_equal Constructor, fixture.class
366
- assert_equal "new", fixture.name
367
- assert_equal "Ajax.Request", fixture.namespace_string
368
- assert_equal "new Ajax.Request", fixture.full_name
369
- assert_equal "Request", fixture.klass_name
370
- assert_equal Klass, fixture.klass.class
371
- assert_equal "Ajax.Request", fixture.klass.full_name
372
- assert_equal "ajax", fixture.section.name
373
- assert_equal Klass, fixture.namespace.class
374
- assert_equal "Ajax.Request", fixture.namespace.full_name
375
- assert !fixture.deprecated?
376
- assert !fixture.alias?
377
- assert !fixture.methodized?
378
- assert_equal "Request", fixture.doc_parent.name
379
- assert_equal %w[Request Ajax ajax], fixture.ancestors.map(&:name)
380
- assert_equal [], fixture.children
381
- assert_equal [], fixture.descendants
382
- end
383
-
384
- def test_deprecated
385
- fixture = fixtures.find_by_name("Toggle")
386
-
387
- assert_equal Namespace, fixture.class
388
- assert_equal [], fixture.mixins
389
- assert_equal "Toggle", fixture.name
390
- assert_equal nil, fixture.klass
391
- assert_equal "DOM", fixture.section.name
392
- assert_equal "", fixture.namespace_string
393
- assert_equal nil, fixture.namespace
394
- assert fixture.deprecated?
395
- assert !fixture.alias?
396
- assert_equal %w[display foo], fixture.klass_methods.map(&:name)
397
- assert_equal [], fixture.klass_properties
398
- assert_equal [], fixture.instance_methods
399
- assert_equal [], fixture.instance_properties
400
- assert_equal [], fixture.related_utilities
401
- assert_equal "DOM", fixture.doc_parent.name
402
- assert_equal %w[DOM], fixture.ancestors.map(&:name)
403
- assert_equal %w[], fixture.children.map(&:name)
404
- assert_equal %w[], fixture.descendants.map(&:name)
405
-
406
- fixture = fixtures.find_by_name("Toggle.display")
407
- assert_equal KlassMethod, fixture.class
408
- assert_equal "display", fixture.name
409
- assert_equal "Toggle", fixture.namespace_string
410
- assert_equal "Toggle.display", fixture.full_name
411
- assert_equal nil, fixture.klass_name
412
- assert_equal "DOM", fixture.section.name
413
- assert_equal Namespace, fixture.namespace.class
414
- assert_equal "Toggle", fixture.namespace.full_name
415
- assert fixture.deprecated?
416
- assert !fixture.alias?
417
- assert_equal "Toggle", fixture.doc_parent.name
418
- assert_equal %w[Toggle DOM], fixture.ancestors.map(&:name)
419
- assert_equal [], fixture.children
420
- assert_equal [], fixture.descendants
421
-
422
- fixture = fixtures.find_by_name("Toggle.foo")
423
- assert_equal KlassMethod, fixture.class
424
- assert_equal "foo", fixture.name
425
- assert_equal "Toggle", fixture.namespace_string
426
- assert_equal "Toggle.foo", fixture.full_name
427
- assert_equal nil, fixture.klass_name
428
- assert_equal "DOM", fixture.section.name
429
- assert_equal Namespace, fixture.namespace.class
430
- assert_equal "Toggle", fixture.namespace.full_name
431
- assert fixture.deprecated?
432
- assert !fixture.alias?
433
- assert_equal "Toggle", fixture.doc_parent.name
434
- assert_equal %w[Toggle DOM], fixture.ancestors.map(&:name)
435
- assert_equal [], fixture.children
436
- assert_equal [], fixture.descendants
437
- end
438
-
439
- def test_description
440
- assert_equal "The Element class", fixtures.find_by_name("Element").description
441
- assert_equal "Sets the style of element\nand returns it", fixtures.find_by_name("Element.setStyle").description
442
- assert_equal "Calls `iterator` for each item in the collection.", fixtures.find_by_name("Enumerable#each").description
443
- end
444
-
445
- def test_arguments_descriptions
446
- fixture = fixtures.find_by_name("Element.setStyle")
447
- assert_equal %w[element styles], fixture.arguments.map(&:name)
448
- assert_equal %w[String Element], fixture.arguments.first.types
449
- assert_equal "an id or DOM node", fixture.arguments.first.description
450
- assert_equal %w[String Object Hash], fixture.arguments.last.types
451
- assert_equal "can be either a regular CSS string or a hash or regular object, in which case, properties need to be camelized",
452
- fixture.arguments.last.description
453
-
454
- assert_equal [], fixtures.find_by_name("Element#foo").arguments
455
- end
456
-
457
- def test_event
458
- assert_equal %w[element:style:updated], fixtures.find_by_name("Element.setStyle").fires
459
- assert_equal [], fixtures.find_by_name("Element#foo").fires
460
- assert_equal %w[click], fixtures.find_by_name("Element#bar").fires
461
- end
462
-
463
- def test_aliases
464
- fixture = fixtures.find_by_name("Element.setStyle")
465
- assert_equal [], fixture.aliases
466
- assert !fixture.alias?
467
- assert_equal nil, fixture.alias_of
468
-
469
- fixture = fixtures.find_by_name("Element#foo")
470
- assert_equal ["bar"], fixture.aliases.map(&:name)
471
- assert !fixture.alias?
472
- assert_equal nil, fixture.alias_of
473
-
474
- fixture = fixtures.find_by_name("Element#bar")
475
- assert_equal [], fixture.aliases.map(&:name)
476
- assert fixture.alias?
477
- assert_equal "foo", fixture.alias_of.name
478
- end
479
-
480
- def test_weird
481
- weird = parse(<<-EOS
482
-
483
- /** section: DOM
484
- * document
485
- *
486
- * Prototype extends the built-in `document` object with several convenience
487
- * methods related to events.
488
- **/
489
-
490
-
491
- EOS
492
- )
493
- doc = weird.find_by_name("document")
494
- assert_equal 'document', doc.name
495
- assert_equal Documentation::Namespace, doc.class
496
- end
497
-
498
- def test_weirder
499
- weird = parse(<<-EOS
500
-
501
- /**
502
- * document.viewport
503
- *
504
- * The `document.viewport` namespace contains methods that return information
505
- * about the viewport &mdash; the rectangle that represents the portion of a web
506
- * page within view. In other words, it's the browser window minus all chrome.
507
- **/
508
-
509
-
510
- EOS
511
- )
512
- doc = weird.find_by_name("document.viewport")
513
- assert_equal 'viewport', doc.name
514
- assert_equal Documentation::Namespace, doc.class
515
- end
516
-
517
- def test_weirdest
518
-
519
- end
520
- end