ember-cli-assets 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/lib/ember/cli/assets/version.rb +1 -1
- data/lib/ember/cli/loader.rb +1 -1
- data/vendor/assets/ember/loader.js +37 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b897477f94bc19709030dfdcfdcfb625d8b14156
|
4
|
+
data.tar.gz: 0bbaba61b1f5a1a77b2922566c6606f34c75cad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c1df6d52a62d9e3243a15b8cab43eccdb1a812466b7ed75756889dddf1feb50fd4c510f494954d3b1d53506c642bbf1b59c0d4da4854aadb77099562fc28258
|
7
|
+
data.tar.gz: 97eb8a779e2026563ef27ea72b90304e2f893de6b0520bea28536b3626db11dc54a31c9deb85ea9da1f64c04902999e0f7093ee38e7e9892e27c3cba1934110b
|
data/.travis.yml
CHANGED
data/lib/ember/cli/loader.rb
CHANGED
@@ -52,7 +52,7 @@ var loader, define, requireModule, require, requirejs;
|
|
52
52
|
|
53
53
|
var defaultDeps = ['require', 'exports', 'module'];
|
54
54
|
|
55
|
-
function Module(name, deps, callback) {
|
55
|
+
function Module(name, deps, callback, alias) {
|
56
56
|
this.id = uuid++;
|
57
57
|
this.name = name;
|
58
58
|
this.deps = !deps.length && callback.length ? defaultDeps : deps;
|
@@ -62,6 +62,8 @@ var loader, define, requireModule, require, requirejs;
|
|
62
62
|
this._require = undefined;
|
63
63
|
this.finalized = false;
|
64
64
|
this.hasExportsAsDep = false;
|
65
|
+
this.isAlias = alias;
|
66
|
+
this.reified = new Array(deps.length);
|
65
67
|
}
|
66
68
|
|
67
69
|
Module.prototype.makeDefaultExport = function() {
|
@@ -73,14 +75,14 @@ var loader, define, requireModule, require, requirejs;
|
|
73
75
|
}
|
74
76
|
};
|
75
77
|
|
76
|
-
Module.prototype.exports = function(
|
78
|
+
Module.prototype.exports = function() {
|
77
79
|
if (this.finalized) {
|
78
80
|
return this.module.exports;
|
79
81
|
} else {
|
80
82
|
if (loader.wrapModules) {
|
81
83
|
this.callback = loader.wrapModules(this.name, this.callback);
|
82
84
|
}
|
83
|
-
var result = this.callback.apply(this,
|
85
|
+
var result = this.callback.apply(this, this.reified);
|
84
86
|
if (!(this.hasExportsAsDep && result === undefined)) {
|
85
87
|
this.module.exports = result;
|
86
88
|
}
|
@@ -98,11 +100,10 @@ var loader, define, requireModule, require, requirejs;
|
|
98
100
|
|
99
101
|
Module.prototype.reify = function() {
|
100
102
|
var deps = this.deps;
|
101
|
-
var length = deps.length;
|
102
|
-
var reified = new Array(length);
|
103
103
|
var dep;
|
104
|
+
var reified = this.reified;
|
104
105
|
|
105
|
-
for (var i = 0
|
106
|
+
for (var i = 0; i < deps.length; i++) {
|
106
107
|
dep = deps[i];
|
107
108
|
if (dep === 'exports') {
|
108
109
|
this.hasExportsAsDep = true;
|
@@ -115,8 +116,6 @@ var loader, define, requireModule, require, requirejs;
|
|
115
116
|
reified[i] = findModule(resolve(dep, this.name), this.name).module.exports;
|
116
117
|
}
|
117
118
|
}
|
118
|
-
|
119
|
-
return reified;
|
120
119
|
};
|
121
120
|
|
122
121
|
Module.prototype.makeRequire = function() {
|
@@ -128,9 +127,10 @@ var loader, define, requireModule, require, requirejs;
|
|
128
127
|
};
|
129
128
|
|
130
129
|
Module.prototype.build = function() {
|
131
|
-
if (this.state === FAILED) { return; }
|
130
|
+
if (this.state === FAILED || this.state === LOADED) { return; }
|
132
131
|
this.state = FAILED;
|
133
|
-
this.
|
132
|
+
this.reify()
|
133
|
+
this.exports();
|
134
134
|
this.state = LOADED;
|
135
135
|
};
|
136
136
|
|
@@ -144,7 +144,11 @@ var loader, define, requireModule, require, requirejs;
|
|
144
144
|
deps = [];
|
145
145
|
}
|
146
146
|
|
147
|
-
|
147
|
+
if (callback instanceof Alias) {
|
148
|
+
registry[name] = new Module(callback.name, deps, callback, true);
|
149
|
+
} else {
|
150
|
+
registry[name] = new Module(name, deps, callback, false);
|
151
|
+
}
|
148
152
|
};
|
149
153
|
|
150
154
|
// we don't support all of AMD
|
@@ -171,9 +175,8 @@ var loader, define, requireModule, require, requirejs;
|
|
171
175
|
function findModule(name, referrer) {
|
172
176
|
var mod = registry[name] || registry[name + '/index'];
|
173
177
|
|
174
|
-
while (mod && mod.
|
175
|
-
|
176
|
-
mod = registry[name];
|
178
|
+
while (mod && mod.isAlias) {
|
179
|
+
mod = registry[mod.name];
|
177
180
|
}
|
178
181
|
|
179
182
|
if (!mod) { missingModule(name, referrer); }
|
@@ -214,4 +217,24 @@ var loader, define, requireModule, require, requirejs;
|
|
214
217
|
requirejs.entries = requirejs._eak_seen = registry = {};
|
215
218
|
seen = {};
|
216
219
|
};
|
220
|
+
|
221
|
+
// prime
|
222
|
+
define('foo', function() {});
|
223
|
+
define('foo/bar', [], function() {});
|
224
|
+
define('foo/asdf', ['module', 'exports', 'require'], function(module, exports, require) {
|
225
|
+
require('foo/bar');
|
226
|
+
});
|
227
|
+
define('foo/baz', [], define.alias('foo'));
|
228
|
+
define('foo/quz', define.alias('foo'));
|
229
|
+
define('foo/bar', ['foo', './quz', './baz', './asdf', './bar', '../foo'], function() {});
|
230
|
+
define('foo/main', ['foo/bar'], function() {});
|
231
|
+
|
232
|
+
require('foo/main');
|
233
|
+
require.unsee('foo/bar');
|
234
|
+
|
235
|
+
requirejs.clear();
|
236
|
+
|
237
|
+
if (typeof module !== 'undefined') {
|
238
|
+
module.exports = { require: require, define: define };
|
239
|
+
}
|
217
240
|
})(this);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-cli-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|