jsduck 4.6.0 → 4.6.1
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 +1 -0
- data/Rakefile +4 -0
- data/js-classes/Array.js +494 -1
- data/js-classes/Date.js +22 -0
- data/js-classes/Function.js +80 -0
- data/js-classes/Object.js +638 -0
- data/js-classes/RegExp.js +1 -1
- data/js-classes/String.js +19 -1
- data/jsduck.gemspec +2 -2
- data/lib/jsduck/assets.rb +1 -1
- data/lib/jsduck/class.rb +2 -2
- data/lib/jsduck/members_index.rb +24 -12
- data/lib/jsduck/options.rb +5 -3
- data/lib/jsduck/welcome.rb +7 -4
- metadata +4 -4
data/js-classes/RegExp.js
CHANGED
@@ -90,7 +90,7 @@
|
|
90
90
|
* | |
|
91
91
|
* | | `/\d+(?!\.)/.exec("3.141")` matches 141 but not 3.141.
|
92
92
|
* | |
|
93
|
-
*
|
93
|
+
* |<code>x|y</code>| Matches either `x` or `y`.
|
94
94
|
* | |
|
95
95
|
* | | For example, `/green|red/` matches 'green' in "green apple" and 'red' in "red apple."
|
96
96
|
* | |
|
data/js-classes/String.js
CHANGED
@@ -1033,4 +1033,22 @@
|
|
1033
1033
|
* alert(x.valueOf()) // Displays "Hello world"
|
1034
1034
|
*
|
1035
1035
|
* @return {String} Returns value of string.
|
1036
|
-
*/
|
1036
|
+
*/
|
1037
|
+
|
1038
|
+
// ECMAScript 5 methods
|
1039
|
+
|
1040
|
+
/**
|
1041
|
+
* @method trim
|
1042
|
+
* Removes whitespace from both ends of the string.
|
1043
|
+
*
|
1044
|
+
* Does not affect the value of the string itself.
|
1045
|
+
*
|
1046
|
+
* The following example displays the lowercase string `"foo"`:
|
1047
|
+
*
|
1048
|
+
* var orig = " foo ";
|
1049
|
+
* alert(orig.trim());
|
1050
|
+
*
|
1051
|
+
* **NOTE:** This method is part of the ECMAScript 5 standard.
|
1052
|
+
*
|
1053
|
+
* @return {String} A string stripped of whitespace on both ends.
|
1054
|
+
*/
|
data/jsduck.gemspec
CHANGED
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.required_rubygems_version = ">= 1.3.5"
|
3
3
|
|
4
4
|
s.name = 'jsduck'
|
5
|
-
s.version = '4.6.
|
6
|
-
s.date = '2013-01-
|
5
|
+
s.version = '4.6.1'
|
6
|
+
s.date = '2013-01-17'
|
7
7
|
s.summary = "Simple JavaScript Duckumentation generator"
|
8
8
|
s.description = "Documentation generator for Sencha JS frameworks"
|
9
9
|
s.homepage = "https://github.com/senchalabs/jsduck"
|
data/lib/jsduck/assets.rb
CHANGED
@@ -30,7 +30,7 @@ module JsDuck
|
|
30
30
|
doc_formatter.relations = @relations
|
31
31
|
|
32
32
|
@images = Images.new(@opts.images)
|
33
|
-
@welcome = Welcome.create(@opts.welcome)
|
33
|
+
@welcome = Welcome.create(@opts.welcome, doc_formatter)
|
34
34
|
@guides = Guides.create(@opts.guides, doc_formatter, @opts)
|
35
35
|
@videos = Videos.create(@opts.videos)
|
36
36
|
@examples = Examples.create(@opts.examples, @opts)
|
data/lib/jsduck/class.rb
CHANGED
@@ -152,9 +152,9 @@ module JsDuck
|
|
152
152
|
ms = @members_index.global_by_name[query[:name]] || []
|
153
153
|
ms = ms.find_all {|m| m[:owner] == @doc[:name]} if query[:local]
|
154
154
|
elsif query[:local]
|
155
|
-
ms = @members_index.
|
155
|
+
ms = @members_index.all_local
|
156
156
|
else
|
157
|
-
ms = @members_index.
|
157
|
+
ms = @members_index.all_global
|
158
158
|
end
|
159
159
|
|
160
160
|
if query[:tagname]
|
data/lib/jsduck/members_index.rb
CHANGED
@@ -31,6 +31,30 @@ module JsDuck
|
|
31
31
|
@global_map_by_name
|
32
32
|
end
|
33
33
|
|
34
|
+
# Returns array of all members (including inherited ones)
|
35
|
+
def all_global
|
36
|
+
global_by_id.values
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns array of all local members (excludes inherited ones)
|
40
|
+
def all_local
|
41
|
+
local_by_id.values.reject {|m| m[:meta] && m[:meta][:hide] }
|
42
|
+
end
|
43
|
+
|
44
|
+
# Clears the search cache.
|
45
|
+
# Using this is REALLY BAD - try to get rid of it.
|
46
|
+
def invalidate!
|
47
|
+
@map_by_id = nil
|
48
|
+
@global_map_by_id = nil
|
49
|
+
@global_map_by_name = nil
|
50
|
+
|
51
|
+
@cls.parent.members_index.invalidate! if @cls.parent
|
52
|
+
|
53
|
+
@cls.mixins.each {|mix| mix.members_index.invalidate! }
|
54
|
+
end
|
55
|
+
|
56
|
+
protected
|
57
|
+
|
34
58
|
# Returns hash of all members by ID (including inherited ones)
|
35
59
|
def global_by_id
|
36
60
|
unless @global_map_by_id
|
@@ -64,18 +88,6 @@ module JsDuck
|
|
64
88
|
@map_by_id
|
65
89
|
end
|
66
90
|
|
67
|
-
# Clears the search cache.
|
68
|
-
# Using this is REALLY BAD - try to get rid of it.
|
69
|
-
def invalidate!
|
70
|
-
@map_by_id = nil
|
71
|
-
@global_map_by_id = nil
|
72
|
-
@global_map_by_name = nil
|
73
|
-
|
74
|
-
@cls.parent.members_index.invalidate! if @cls.parent
|
75
|
-
|
76
|
-
@cls.mixins.each {|mix| mix.members_index.invalidate! }
|
77
|
-
end
|
78
|
-
|
79
91
|
private
|
80
92
|
|
81
93
|
# merges second members hash into first one
|
data/lib/jsduck/options.rb
CHANGED
@@ -91,7 +91,7 @@ module JsDuck
|
|
91
91
|
@ext4_events = nil
|
92
92
|
@meta_tag_paths = []
|
93
93
|
|
94
|
-
@version = "4.6.
|
94
|
+
@version = "4.6.1"
|
95
95
|
|
96
96
|
# Customizing output
|
97
97
|
@title = "Documentation - JSDuck"
|
@@ -292,9 +292,11 @@ module JsDuck
|
|
292
292
|
end
|
293
293
|
|
294
294
|
opts.on('--welcome=PATH',
|
295
|
-
"
|
295
|
+
"File with content for welcome page.",
|
296
296
|
"",
|
297
|
-
"
|
297
|
+
"Either HTML or Markdown file with content for welcome page.",
|
298
|
+
"HTML file must only contain the <body> part of the page.",
|
299
|
+
"Markdown file must have a .md or .markdown extension.",
|
298
300
|
"",
|
299
301
|
"See also: https://github.com/senchalabs/jsduck/wiki/Welcome-page") do |path|
|
300
302
|
@welcome = canonical(path)
|
data/lib/jsduck/welcome.rb
CHANGED
@@ -5,17 +5,20 @@ module JsDuck
|
|
5
5
|
|
6
6
|
class Welcome
|
7
7
|
# Creates Welcome object from filename.
|
8
|
-
def self.create(filename)
|
8
|
+
def self.create(filename, doc_formatter)
|
9
9
|
if filename
|
10
|
-
Welcome.new(filename)
|
10
|
+
Welcome.new(filename, doc_formatter)
|
11
11
|
else
|
12
12
|
Util::NullObject.new(:to_html => "")
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
# Parses welcome HTML file with content for welcome page.
|
17
|
-
def initialize(filename)
|
16
|
+
# Parses welcome HTML or Markdown file with content for welcome page.
|
17
|
+
def initialize(filename, doc_formatter)
|
18
18
|
@html = Util::IO.read(filename)
|
19
|
+
if filename =~ /\.(md|markdown)\Z/i
|
20
|
+
@html = '<div class="markdown">' + doc_formatter.format(@html) + '</div>'
|
21
|
+
end
|
19
22
|
end
|
20
23
|
|
21
24
|
# Returns the HTML
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsduck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.6.
|
4
|
+
version: 4.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdiscount
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- lib/jsduck/videos.rb
|
260
260
|
- lib/jsduck/web_writer.rb
|
261
261
|
- lib/jsduck/welcome.rb
|
262
|
+
- template-min/app-1c3b39672c292d36e4a5ff05c1bb7035.js
|
262
263
|
- template-min/README.md
|
263
264
|
- template-min/template.html
|
264
265
|
- template-min/index-template.html
|
@@ -312,10 +313,9 @@ files:
|
|
312
313
|
- template-min/resources/images/header.png
|
313
314
|
- template-min/resources/images/print.png
|
314
315
|
- template-min/resources/images/tablet-l.jpg
|
315
|
-
- template-min/resources/css/app-
|
316
|
+
- template-min/resources/css/app-88de2e4b4aaefeb72bd4003a88ad5c26.css
|
316
317
|
- template-min/resources/prettify/prettify.js
|
317
318
|
- template-min/resources/prettify/prettify.css
|
318
|
-
- template-min/app-164f134c52b6dc87188110504cc189e5.js
|
319
319
|
- template-min/print-template.html
|
320
320
|
- template-min/favicon.ico
|
321
321
|
- template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-sides.gif
|