jsduck 3.0.pre → 3.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +21 -229
- data/Rakefile +31 -17
- data/bin/jsduck +1 -0
- data/js-classes/Array.js +561 -0
- data/js-classes/Boolean.js +110 -0
- data/js-classes/Date.js +999 -0
- data/js-classes/Function.js +256 -0
- data/js-classes/Number.js +308 -0
- data/js-classes/Object.js +404 -0
- data/js-classes/RegExp.js +415 -0
- data/js-classes/String.js +1034 -0
- data/jsduck.gemspec +2 -2
- data/lib/jsduck/accessors.rb +71 -0
- data/lib/jsduck/aggregator.rb +14 -2
- data/lib/jsduck/app.rb +6 -5
- data/lib/jsduck/class_formatter.rb +12 -8
- data/lib/jsduck/css_parser.rb +2 -2
- data/lib/jsduck/doc_formatter.rb +2 -2
- data/lib/jsduck/doc_parser.rb +32 -25
- data/lib/jsduck/exporter.rb +1 -1
- data/lib/jsduck/guides.rb +11 -2
- data/lib/jsduck/js_parser.rb +30 -8
- data/lib/jsduck/merger.rb +31 -16
- data/lib/jsduck/options.rb +93 -15
- data/lib/jsduck/renderer.rb +40 -3
- data/lib/jsduck/search_data.rb +8 -5
- data/lib/jsduck/source_file.rb +5 -4
- data/lib/jsduck/type_parser.rb +7 -6
- metadata +17 -5
- data/example.js +0 -144
data/lib/jsduck/type_parser.rb
CHANGED
@@ -46,9 +46,6 @@ module JsDuck
|
|
46
46
|
return false unless base_type
|
47
47
|
end
|
48
48
|
|
49
|
-
# The definition might end with an ellipsis
|
50
|
-
@out << "..." if @input.scan(/\.\.\./)
|
51
|
-
|
52
49
|
# Concatenate all output
|
53
50
|
@out = @out.join
|
54
51
|
|
@@ -58,11 +55,11 @@ module JsDuck
|
|
58
55
|
|
59
56
|
# The basic type
|
60
57
|
#
|
61
|
-
# <ident> [ "." <ident> ]* [ "[]" ]
|
58
|
+
# <ident> [ "." <ident> ]* [ "[]" ]* [ "..." ]
|
62
59
|
#
|
63
60
|
# dot-separated identifiers followed by optional "[]"
|
64
61
|
def base_type
|
65
|
-
type = @input.scan(/[a-zA-
|
62
|
+
type = @input.scan(/[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*/)
|
66
63
|
|
67
64
|
if !type
|
68
65
|
return false
|
@@ -75,7 +72,11 @@ module JsDuck
|
|
75
72
|
return false
|
76
73
|
end
|
77
74
|
|
78
|
-
|
75
|
+
while @input.scan(/\[\]/)
|
76
|
+
@out << "[]"
|
77
|
+
end
|
78
|
+
|
79
|
+
@out << "..." if @input.scan(/\.\.\./)
|
79
80
|
|
80
81
|
true
|
81
82
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsduck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: -1876988247
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- pre2
|
10
|
+
version: 3.0.pre2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rene Saarsoo
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-09-
|
19
|
+
date: 2011-09-20 00:00:00 +03:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -75,8 +75,16 @@ files:
|
|
75
75
|
- README.md
|
76
76
|
- Rakefile
|
77
77
|
- bin/jsduck
|
78
|
-
-
|
78
|
+
- js-classes/Array.js
|
79
|
+
- js-classes/Boolean.js
|
80
|
+
- js-classes/Date.js
|
81
|
+
- js-classes/Function.js
|
82
|
+
- js-classes/Number.js
|
83
|
+
- js-classes/Object.js
|
84
|
+
- js-classes/RegExp.js
|
85
|
+
- js-classes/String.js
|
79
86
|
- jsduck.gemspec
|
87
|
+
- lib/jsduck/accessors.rb
|
80
88
|
- lib/jsduck/aggregator.rb
|
81
89
|
- lib/jsduck/aliases.rb
|
82
90
|
- lib/jsduck/app.rb
|
@@ -151,6 +159,8 @@ files:
|
|
151
159
|
- template-min/resources/images/print.png
|
152
160
|
- template-min/resources/images/methods.png
|
153
161
|
- template-min/resources/css/app.css
|
162
|
+
- template-min/resources/prettify/prettify.js
|
163
|
+
- template-min/resources/prettify/prettify.css
|
154
164
|
- template-min/app.js
|
155
165
|
- template-min/egIframe.html
|
156
166
|
- template-min/print-template.html
|
@@ -185,8 +195,10 @@ files:
|
|
185
195
|
- template-min/extjs/resources/themes/images/default/tools/tool-sprites.gif
|
186
196
|
- template-min/extjs/resources/themes/images/default/tools/tool-sprite-tpl.gif
|
187
197
|
- template-min/extjs/resources/themes/images/default/tools/tools-sprites-trans.gif
|
198
|
+
- template-min/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-corners.gif
|
188
199
|
- template-min/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-sides.gif
|
189
200
|
- template-min/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-corners.gif
|
201
|
+
- template-min/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-sides.gif
|
190
202
|
- template-min/extjs/resources/themes/images/default/datepicker/datepicker-header-bg.gif
|
191
203
|
- template-min/extjs/resources/themes/images/default/datepicker/datepicker-footer-bg.png
|
192
204
|
- template-min/extjs/resources/themes/images/default/datepicker/datepicker-header-bg.png
|
data/example.js
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* An example class showcasing the features of JSDuck.
|
3
|
-
*
|
4
|
-
* **Markdown** is supported thoughout the [docs][1].
|
5
|
-
*
|
6
|
-
* Link to {@link Ext.form.field.Text external class} and
|
7
|
-
* {@link Ext.form.field.Text#reset its method}.
|
8
|
-
* Link to {@link #setSize method of this class}.
|
9
|
-
*
|
10
|
-
* {@img some/path.png Alt text}
|
11
|
-
*
|
12
|
-
* An embedded live example:
|
13
|
-
*
|
14
|
-
* @example
|
15
|
-
* Ext.create('Ext.master.Switch', {
|
16
|
-
* text: 'Click me, please!',
|
17
|
-
* handler: function() {
|
18
|
-
* alert('You clicked me!')
|
19
|
-
* }
|
20
|
-
* });
|
21
|
-
*
|
22
|
-
* [1]: http://docs.sencha.com/ext-js/4.0/
|
23
|
-
*
|
24
|
-
* @author Rene Saarsoo <rene@example.com>
|
25
|
-
* @docauthor John Smith <john@example.com>
|
26
|
-
*/
|
27
|
-
Ext.define('Ext.master.Switch', {
|
28
|
-
// These are all detected automatically
|
29
|
-
// No need to use @extends, @alternateClassName, @mixin, @singleton
|
30
|
-
extend: 'Ext.button.Button',
|
31
|
-
alternateClassName: 'Ext.MasterSwitch',
|
32
|
-
mixins: {
|
33
|
-
observable: 'Ext.util.Observable',
|
34
|
-
floating: 'Ext.util.Floating'
|
35
|
-
},
|
36
|
-
singleton: true,
|
37
|
-
|
38
|
-
// The same as: @xtype masterswitch
|
39
|
-
alias: 'widget.masterswitch',
|
40
|
-
|
41
|
-
/**
|
42
|
-
* @cfg {String} [text="Click Me!"]
|
43
|
-
* A config option with explicit type, name, and default value.
|
44
|
-
*/
|
45
|
-
|
46
|
-
/**
|
47
|
-
* @cfg
|
48
|
-
* A config option with type (String), name (icon), and default value
|
49
|
-
* ("some/file.png") auto-detected.
|
50
|
-
*/
|
51
|
-
icon: "some/file.png",
|
52
|
-
|
53
|
-
/**
|
54
|
-
* @cfg {String} name (required)
|
55
|
-
* A very importand config option that must be specified.
|
56
|
-
*/
|
57
|
-
|
58
|
-
/**
|
59
|
-
* @property {Object} size
|
60
|
-
* A property with explicit type name and name.
|
61
|
-
* An object containing the following fields:
|
62
|
-
* @property {Number} size.width The width.
|
63
|
-
* @property {Number} size.height The height.
|
64
|
-
*/
|
65
|
-
|
66
|
-
/**
|
67
|
-
* @property
|
68
|
-
* A property with auto-detected type (Boolean) and name (disabled).
|
69
|
-
*/
|
70
|
-
disabled: false,
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Constructor documentation.
|
74
|
-
* @param {Object} [cfg] An optional config object
|
75
|
-
*/
|
76
|
-
constructor: function(cfg) {
|
77
|
-
Ext.apply(this, cfg || {});
|
78
|
-
this.addEvents(
|
79
|
-
/**
|
80
|
-
* @event
|
81
|
-
* Fired when button clicked.
|
82
|
-
* @param {Ext.master.Switch} this
|
83
|
-
*/
|
84
|
-
"click"
|
85
|
-
);
|
86
|
-
},
|
87
|
-
|
88
|
-
/**
|
89
|
-
* Sets the size.
|
90
|
-
* @param {Object} size An object describing width and height.
|
91
|
-
* If either of them is left unspecified, it defaults to `0`.
|
92
|
-
* @param {Number} [size.width=0] The width.
|
93
|
-
* @param {Number} [size.height=0] The height.
|
94
|
-
*/
|
95
|
-
setSize: function(size) {
|
96
|
-
this.size = size;
|
97
|
-
},
|
98
|
-
|
99
|
-
/**
|
100
|
-
* Returns the size of component.
|
101
|
-
* @return {Object} Object with properties:
|
102
|
-
* @return {Number} return.width The width.
|
103
|
-
* @return {Number} return.height The height.
|
104
|
-
* @method
|
105
|
-
*/
|
106
|
-
getSize: (function() {
|
107
|
-
return function() { return this.size; };
|
108
|
-
})(),
|
109
|
-
|
110
|
-
statics: {
|
111
|
-
/**
|
112
|
-
* Filters out subcomponents.
|
113
|
-
* @param {Function} fn Callback function.
|
114
|
-
* @param {Ext.Component} fn.cmp The component.
|
115
|
-
* @param {Number} fn.index Component index.
|
116
|
-
* @param {Boolean} fn.return True to include the component, false to exclude.
|
117
|
-
* @param {Object} scope Scope for the callback.
|
118
|
-
* @return {Ext.Component[]} Array of components.
|
119
|
-
* @static
|
120
|
-
*/
|
121
|
-
filter: function(fn, scope) {
|
122
|
-
return this.items.filter(fn, scope);
|
123
|
-
}
|
124
|
-
},
|
125
|
-
|
126
|
-
inheritableStatics: {
|
127
|
-
/**
|
128
|
-
* Achieves something.
|
129
|
-
* @static
|
130
|
-
* @inheritable
|
131
|
-
*/
|
132
|
-
doSomething: function() {
|
133
|
-
}
|
134
|
-
}
|
135
|
-
});
|
136
|
-
|
137
|
-
Ext.apply(Ext, {
|
138
|
-
/**
|
139
|
-
* A method belonging to Ext.
|
140
|
-
* @member Ext
|
141
|
-
* @alias Ext.master.Switch#setSize
|
142
|
-
*/
|
143
|
-
setMasterSwitchSize: Ext.master.Switch.setSize
|
144
|
-
});
|