almond-rails 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/almond_rails/version.rb +1 -1
- data/vendor/assets/javascripts/almond.js +18 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc94a7377ee1035b0427a566f335cd5d3d2c15f2
|
4
|
+
data.tar.gz: '0482dadb859bcb79202b68f3fb671f7d26adb091'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0602ac69a89534c23ad7d5cc4191a859201a91fd663b33c639d95349fca87070dec17970ca419cb507b870f2df38343c3bd2e1ed1fe3dc99e478e4625c9cbc49
|
7
|
+
data.tar.gz: 9b86986f606bb3923cab56a857d6c7804fdffa7cdc510516bb57c897e25e25f31919703d7f77aab32d1df23f84a6d029c136cc0648b36012973b359d991eb410
|
data/lib/almond_rails/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license almond 0.3.
|
2
|
+
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
3
3
|
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
4
4
|
*/
|
5
5
|
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
@@ -195,32 +195,39 @@ var requirejs, require, define;
|
|
195
195
|
return [prefix, name];
|
196
196
|
}
|
197
197
|
|
198
|
+
//Creates a parts array for a relName where first part is plugin ID,
|
199
|
+
//second part is resource ID. Assumes relName has already been normalized.
|
200
|
+
function makeRelParts(relName) {
|
201
|
+
return relName ? splitPrefix(relName) : [];
|
202
|
+
}
|
203
|
+
|
198
204
|
/**
|
199
205
|
* Makes a name map, normalizing the name, and using a plugin
|
200
206
|
* for normalization if necessary. Grabs a ref to plugin
|
201
207
|
* too, as an optimization.
|
202
208
|
*/
|
203
|
-
makeMap = function (name,
|
209
|
+
makeMap = function (name, relParts) {
|
204
210
|
var plugin,
|
205
211
|
parts = splitPrefix(name),
|
206
|
-
prefix = parts[0]
|
212
|
+
prefix = parts[0],
|
213
|
+
relResourceName = relParts[1];
|
207
214
|
|
208
215
|
name = parts[1];
|
209
216
|
|
210
217
|
if (prefix) {
|
211
|
-
prefix = normalize(prefix,
|
218
|
+
prefix = normalize(prefix, relResourceName);
|
212
219
|
plugin = callDep(prefix);
|
213
220
|
}
|
214
221
|
|
215
222
|
//Normalize according
|
216
223
|
if (prefix) {
|
217
224
|
if (plugin && plugin.normalize) {
|
218
|
-
name = plugin.normalize(name, makeNormalize(
|
225
|
+
name = plugin.normalize(name, makeNormalize(relResourceName));
|
219
226
|
} else {
|
220
|
-
name = normalize(name,
|
227
|
+
name = normalize(name, relResourceName);
|
221
228
|
}
|
222
229
|
} else {
|
223
|
-
name = normalize(name,
|
230
|
+
name = normalize(name, relResourceName);
|
224
231
|
parts = splitPrefix(name);
|
225
232
|
prefix = parts[0];
|
226
233
|
name = parts[1];
|
@@ -267,13 +274,14 @@ var requirejs, require, define;
|
|
267
274
|
};
|
268
275
|
|
269
276
|
main = function (name, deps, callback, relName) {
|
270
|
-
var cjsModule, depName, ret, map, i,
|
277
|
+
var cjsModule, depName, ret, map, i, relParts,
|
271
278
|
args = [],
|
272
279
|
callbackType = typeof callback,
|
273
280
|
usingExports;
|
274
281
|
|
275
282
|
//Use name if no relName
|
276
283
|
relName = relName || name;
|
284
|
+
relParts = makeRelParts(relName);
|
277
285
|
|
278
286
|
//Call the callback to define the module, if necessary.
|
279
287
|
if (callbackType === 'undefined' || callbackType === 'function') {
|
@@ -282,7 +290,7 @@ var requirejs, require, define;
|
|
282
290
|
//Default to [require, exports, module] if no deps
|
283
291
|
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
284
292
|
for (i = 0; i < deps.length; i += 1) {
|
285
|
-
map = makeMap(deps[i],
|
293
|
+
map = makeMap(deps[i], relParts);
|
286
294
|
depName = map.f;
|
287
295
|
|
288
296
|
//Fast path CommonJS standard dependencies.
|
@@ -338,7 +346,7 @@ var requirejs, require, define;
|
|
338
346
|
//deps arg is the module name, and second arg (if passed)
|
339
347
|
//is just the relName.
|
340
348
|
//Normalize module name, if it contains . or ..
|
341
|
-
return callDep(makeMap(deps, callback).f);
|
349
|
+
return callDep(makeMap(deps, makeRelParts(callback)).f);
|
342
350
|
} else if (!deps.splice) {
|
343
351
|
//deps is a config object, not an array.
|
344
352
|
config = deps;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: almond-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.6.10
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Almond.js packaged as a Rails engine
|