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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf9a6ebe888202ce387d87c268d592573b0c419c
4
- data.tar.gz: f97246c719574120e8ee3c2df0eaeb227e79a3f9
3
+ metadata.gz: b897477f94bc19709030dfdcfdcfb625d8b14156
4
+ data.tar.gz: 0bbaba61b1f5a1a77b2922566c6606f34c75cad8
5
5
  SHA512:
6
- metadata.gz: 85bd029797961c83e81a514334e1a21bcd9de65250d9a70327054e8299747ff728d50a3f0b373866b5687d0f52d800b3a485242f75daeb261eaa90ec3f0a3b46
7
- data.tar.gz: d7019ba49143a65359564ced594371e95aa6d75cc93c31a5c1c414bea0e25588b0e4a582f2bd9f4649fd4819490e4a1f0fedb74cf4b5947acd41bdc882a19930
6
+ metadata.gz: 4c1df6d52a62d9e3243a15b8cab43eccdb1a812466b7ed75756889dddf1feb50fd4c510f494954d3b1d53506c642bbf1b59c0d4da4854aadb77099562fc28258
7
+ data.tar.gz: 97eb8a779e2026563ef27ea72b90304e2f893de6b0520bea28536b3626db11dc54a31c9deb85ea9da1f64c04902999e0f7093ee38e7e9892e27c3cba1934110b
data/.travis.yml CHANGED
@@ -6,6 +6,9 @@ rvm:
6
6
  - 2.2.4
7
7
  - 2.3.0
8
8
 
9
+ cache:
10
+ - bundler
11
+
9
12
  before_install:
10
13
  - gem install bundler # To use 1.8.x or later
11
14
 
@@ -1,7 +1,7 @@
1
1
  module Ember
2
2
  module CLI
3
3
  module Assets
4
- VERSION = '0.0.25'
4
+ VERSION = '0.0.26'
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Ember
2
2
  module CLI
3
3
  module Loader
4
- VERSION = '4.0.1'
4
+ VERSION = '4.0.2'
5
5
  end
6
6
  end
7
7
  end
@@ -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(reifiedDeps) {
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, reifiedDeps);
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, l = length; i < l; i++) {
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.exports(this.reify());
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
- registry[name] = new Module(name, deps, callback);
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.callback instanceof Alias) {
175
- name = mod.callback.name;
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.25
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-03-04 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler