jazz-jss 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/dist/handlebars/handlebars.js +1493 -0
- data/dist/hashchange/{jquery.ba-hashchange.js → hashchange.js} +0 -0
- data/dist/jazz/lib/controller.js +1 -1
- data/dist/jazz/lib/core.js +3 -0
- data/dist/jazz/lib/db.js +1 -1
- data/dist/jazz/lib/helper.js +2 -1
- data/dist/jazz/lib/model.js +11 -4
- data/dist/jazz/lib/view.js +1 -1
- data/dist/jazz/module.js +15 -0
- data/dist/jquery/jquery.js +0 -0
- data/dist/require/require.js +0 -0
- data/dist/require/template.js +98 -0
- data/dist/underscore/underscore.js +0 -0
- data/lib/jazz/app_detector.rb +6 -3
- data/lib/jazz/app_generator.rb +12 -8
- data/lib/jazz/helper_generator.rb +30 -0
- data/lib/jazz/scaffold_generator.rb +4 -0
- data/templates/app_root/Rakefile +11 -0
- data/templates/app_root/{app → development/app}/assets/javascripts/application.js +0 -0
- data/templates/app_root/{app → development/app}/assets/stylesheets/application.css +0 -0
- data/templates/app_root/development/app/controllers/application_controller.js +11 -0
- data/templates/app_root/development/app/helpers/application_helper.js +7 -0
- data/templates/app_root/development/config/glue.js +9 -0
- data/templates/app_root/development/config/routes.js +5 -0
- data/templates/app_root/scripts/build.js +30 -0
- data/templates/app_root/scripts/r.js/LICENSE +58 -0
- data/templates/app_root/scripts/r.js/README.md +177 -0
- data/templates/app_root/scripts/r.js/build/build.js +26 -0
- data/templates/app_root/scripts/r.js/build/buildebug.sh +4 -0
- data/templates/app_root/scripts/r.js/build/example.build.js +296 -0
- data/templates/app_root/scripts/r.js/build/jslib/blank.js +4 -0
- data/templates/app_root/scripts/r.js/build/jslib/build.js +952 -0
- data/templates/app_root/scripts/r.js/build/jslib/commandLine.js +23 -0
- data/templates/app_root/scripts/r.js/build/jslib/commonJs.js +152 -0
- data/templates/app_root/scripts/r.js/build/jslib/env.js +47 -0
- data/templates/app_root/scripts/r.js/build/jslib/lang.js +49 -0
- data/templates/app_root/scripts/r.js/build/jslib/logger.js +58 -0
- data/templates/app_root/scripts/r.js/build/jslib/node.js +106 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/args.js +20 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/file.js +263 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/load.js +17 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/optimize.js +10 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/print.js +16 -0
- data/templates/app_root/scripts/r.js/build/jslib/optimize.js +279 -0
- data/templates/app_root/scripts/r.js/build/jslib/opto.build.js +11 -0
- data/templates/app_root/scripts/r.js/build/jslib/parse.js +590 -0
- data/templates/app_root/scripts/r.js/build/jslib/pragma.js +251 -0
- data/templates/app_root/scripts/r.js/build/jslib/requirePatch.js +286 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino.js +22 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/args.js +21 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/file.js +244 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/load.js +12 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/optimize.js +100 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/print.js +12 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/README.md +16 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/index.js +21 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/parse-js.js +1342 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/process.js +2005 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/squeeze-more.js +55 -0
- data/templates/app_root/scripts/r.js/build/jslib/x.js +243 -0
- data/templates/app_root/scripts/r.js/build/tests/all.js +47 -0
- data/templates/app_root/scripts/r.js/build/tests/allj.sh +3 -0
- data/templates/app_root/scripts/r.js/build/tests/alln.sh +18 -0
- data/templates/app_root/scripts/r.js/build/tests/anonSimple.build.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/buildUtils.js +19 -0
- data/templates/app_root/scripts/r.js/build/tests/builds.js +489 -0
- data/templates/app_root/scripts/r.js/build/tests/circular.build.js +18 -0
- data/templates/app_root/scripts/r.js/build/tests/convert.js +18 -0
- data/templates/app_root/scripts/r.js/build/tests/css.build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/css/common/common.css +4 -0
- data/templates/app_root/scripts/r.js/build/tests/css/master.css +10 -0
- data/templates/app_root/scripts/r.js/build/tests/css/sub/sub1.css +7 -0
- data/templates/app_root/scripts/r.js/build/tests/cssTestCompare.css +13 -0
- data/templates/app_root/scripts/r.js/build/tests/end.frag +3 -0
- data/templates/app_root/scripts/r.js/build/tests/expected/unoExcludeShallow.js +23 -0
- data/templates/app_root/scripts/r.js/build/tests/exports.build.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/hasTestModule.build.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/hasTestModule.js +30 -0
- data/templates/app_root/scripts/r.js/build/tests/http/httpBuild.js +70 -0
- data/templates/app_root/scripts/r.js/build/tests/http/main.html +28 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/main.js +18 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/one.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/three.js +5 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/two.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/i18n.build.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/indexBuilder.build.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/a.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/b.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/c.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/d.js +5 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/expected.js +36 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/LICENSE +58 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/amdefine.js +188 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/package.json +21 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/bang.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/expected.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/license.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/app.build.js +15 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main-expected.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/build.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/expected.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/main.js +1 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub1.js +1 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub2.js +1 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/expected.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/main.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/build.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/expected.js +47 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/main.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/four.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/one.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/three.js +14 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/two.js +5 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/a.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/b.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/buildWithCE.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/c.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/d.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/e.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-built.js +36 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-builtWithCE.js +42 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/main.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/top.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/a.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/b.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedAll.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedB.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedC.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedD.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNested.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/c.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/d.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-built.js +21 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedAll.js +31 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedB.js +24 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedC.js +24 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedD.js +25 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNested.js +31 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/main.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/converter.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/main.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/plug.js +29 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/util.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/nameOnly.build.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/nodeAll.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/nodeOptimize.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/nodeOptimizeNoCallback.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/order.build.js +16 -0
- data/templates/app_root/scripts/r.js/build/tests/override/override.js +36 -0
- data/templates/app_root/scripts/r.js/build/tests/packages.build.js +59 -0
- data/templates/app_root/scripts/r.js/build/tests/parse.js +103 -0
- data/templates/app_root/scripts/r.js/build/tests/simple.build.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/simpleNamespace.build.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/start.frag +4 -0
- data/templates/app_root/scripts/r.js/build/tests/text.build.js +16 -0
- data/templates/app_root/scripts/r.js/build/tests/textExclude.build.js +16 -0
- data/templates/app_root/scripts/r.js/dist.js +95 -0
- data/templates/app_root/scripts/r.js/dist/README.md +6 -0
- data/templates/app_root/scripts/r.js/dist/r-1.0.0.js +9042 -0
- data/templates/app_root/scripts/r.js/dist/r-edge.js +9191 -0
- data/templates/app_root/scripts/r.js/dist/r.js +9099 -0
- data/templates/app_root/scripts/r.js/lib/closure/COPYING +202 -0
- data/templates/app_root/scripts/r.js/lib/closure/README +292 -0
- data/templates/app_root/scripts/r.js/lib/closure/compiler.jar +0 -0
- data/templates/app_root/scripts/r.js/lib/rhino/LICENSE +4 -0
- data/templates/app_root/scripts/r.js/lib/rhino/js.jar +0 -0
- data/templates/app_root/scripts/r.js/require.js +1952 -0
- data/templates/app_root/scripts/r.js/tasks.txt +2 -0
- data/templates/app_root/scripts/r.js/tests/all.js +49 -0
- data/templates/app_root/scripts/r.js/tests/allNode.js +3 -0
- data/templates/app_root/scripts/r.js/tests/allj.sh +1 -0
- data/templates/app_root/scripts/r.js/tests/alln.sh +2 -0
- data/templates/app_root/scripts/r.js/tests/alpha.js +3 -0
- data/templates/app_root/scripts/r.js/tests/beta.js +6 -0
- data/templates/app_root/scripts/r.js/tests/doh/LICENSE +195 -0
- data/templates/app_root/scripts/r.js/tests/doh/README +12 -0
- data/templates/app_root/scripts/r.js/tests/doh/_browserRunner.js +855 -0
- data/templates/app_root/scripts/r.js/tests/doh/_nodeRunner.js +20 -0
- data/templates/app_root/scripts/r.js/tests/doh/_rhinoRunner.js +17 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/LICENSE +10 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/doh.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/dohaaa.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/woohoo.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.html +316 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.js +1499 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.sh +3 -0
- data/templates/app_root/scripts/r.js/tests/doh/small_logo.png +0 -0
- data/templates/app_root/scripts/r.js/tests/node/canvasTest.js +39 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/README.md +15 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/coffee/foo.coffee +1 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/main.js +13 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/scripts/bar.js +13 -0
- data/templates/app_root/scripts/r.js/tests/node/index.js +11 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/alpha/foo.js +6 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/alpha/hello.html +9 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/foo.js +3 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/server.js +11 -0
- data/templates/app_root/scripts/r.js/tests/relative.js +10 -0
- data/templates/app_root/scripts/r.js/tests/sub/betaSub.js +3 -0
- data/templates/application.js +6 -5
- data/templates/boot.js +42 -0
- data/templates/helper.js +9 -0
- data/templates/index.html +1 -1
- metadata +201 -11
- data/dist/jazz/main.js +0 -65
- data/dist/mustache/mustache.js +0 -324
- data/templates/app_root/config/routes.js +0 -4
- data/templates/glue.js +0 -4
data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/amdefine.js
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
/** vim: et:ts=4:sw=4:sts=4
|
2
|
+
* @license amdefine 0.0.1 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
|
3
|
+
* Available via the MIT or new BSD license.
|
4
|
+
* see: http://github.com/jrburke/amdefine for details
|
5
|
+
*/
|
6
|
+
|
7
|
+
/*jslint strict: false, nomen: false, plusplus: false */
|
8
|
+
/*global module, process, require: true */
|
9
|
+
|
10
|
+
var path = require('path'),
|
11
|
+
loaderCache = {},
|
12
|
+
makeRequire;
|
13
|
+
|
14
|
+
// Null out require for this file so that it is not accidentally used
|
15
|
+
// below, where module.require should be used instead.
|
16
|
+
require = null;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Given a relative module name, like ./something, normalize it to
|
20
|
+
* a real name that can be mapped to a path.
|
21
|
+
* @param {String} name the relative name
|
22
|
+
* @param {String} baseName a real name that the name arg is relative
|
23
|
+
* to.
|
24
|
+
* @returns {String} normalized name
|
25
|
+
*/
|
26
|
+
function normalize(name, baseName) {
|
27
|
+
return path.normalize(path.join(baseName, name));
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Create the normalize() function passed to a loader plugin's
|
32
|
+
* normalize method.
|
33
|
+
*/
|
34
|
+
function makeNormalize(relName) {
|
35
|
+
return function (name) {
|
36
|
+
return normalize(name, relName);
|
37
|
+
};
|
38
|
+
}
|
39
|
+
|
40
|
+
function makeLoad(id) {
|
41
|
+
function load(value) {
|
42
|
+
loaderCache[id] = value;
|
43
|
+
}
|
44
|
+
|
45
|
+
load.fromText = function (id, text) {
|
46
|
+
//This one is difficult because the text can/probably uses
|
47
|
+
//define, and any relative paths and requires should be relative
|
48
|
+
//to that id was it would be found on disk. But this would require
|
49
|
+
//bootstrapping a module/require fairly deeply from node core.
|
50
|
+
//Not sure how best to go about that yet.
|
51
|
+
throw new Error('amdefine does not implement load.fromText');
|
52
|
+
};
|
53
|
+
|
54
|
+
return load;
|
55
|
+
}
|
56
|
+
|
57
|
+
function stringRequire(module, id) {
|
58
|
+
//Split the ID by a ! so that
|
59
|
+
var index = id.indexOf('!'),
|
60
|
+
relId = path.dirname(module.filename),
|
61
|
+
prefix, plugin;
|
62
|
+
|
63
|
+
if (index === -1) {
|
64
|
+
//Straight module lookup. If it is one of the special dependencies,
|
65
|
+
//deal with it, otherwise, delegate to node.
|
66
|
+
if (id === 'require') {
|
67
|
+
return makeRequire(module);
|
68
|
+
} else if (id === 'exports') {
|
69
|
+
return module.exports;
|
70
|
+
} else if (id === 'module') {
|
71
|
+
return module;
|
72
|
+
} else {
|
73
|
+
return module.require(id);
|
74
|
+
}
|
75
|
+
} else {
|
76
|
+
//There is a plugin in play.
|
77
|
+
prefix = id.substring(0, index);
|
78
|
+
id = id.substring(index + 1, id.length);
|
79
|
+
|
80
|
+
plugin = module.require(prefix);
|
81
|
+
|
82
|
+
if (plugin.normalize) {
|
83
|
+
id = plugin.normalize(id, makeNormalize(relId));
|
84
|
+
} else {
|
85
|
+
//Normalize the ID normally.
|
86
|
+
id = normalize(id, relId);
|
87
|
+
}
|
88
|
+
|
89
|
+
if (loaderCache[id]) {
|
90
|
+
return loaderCache[id];
|
91
|
+
} else {
|
92
|
+
plugin.load(id, makeRequire(module), makeLoad(id), {});
|
93
|
+
|
94
|
+
return loaderCache[id];
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
makeRequire = function (module) {
|
100
|
+
function amdRequire(deps, callback) {
|
101
|
+
if (typeof deps === 'string') {
|
102
|
+
//Synchronous, single module require('')
|
103
|
+
return stringRequire(module, deps);
|
104
|
+
} else {
|
105
|
+
//Array of dependencies with a callback.
|
106
|
+
|
107
|
+
//Convert the dependencies to modules.
|
108
|
+
deps = deps.map(function (depName) {
|
109
|
+
return stringRequire(module, depName);
|
110
|
+
});
|
111
|
+
|
112
|
+
//Wait for next tick to call back the require call.
|
113
|
+
process.nextTick(function () {
|
114
|
+
callback.apply(null, deps);
|
115
|
+
});
|
116
|
+
|
117
|
+
//Keeps strict checking in komodo happy.
|
118
|
+
return undefined;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
amdRequire.toUrl = function (filePath) {
|
123
|
+
if (filePath.indexOf('.') === 0) {
|
124
|
+
return normalize(filePath, path.dirname(module.filename));
|
125
|
+
} else {
|
126
|
+
return filePath;
|
127
|
+
}
|
128
|
+
};
|
129
|
+
|
130
|
+
return amdRequire;
|
131
|
+
};
|
132
|
+
|
133
|
+
function amdefine(module) {
|
134
|
+
var alreadyCalled = false;
|
135
|
+
|
136
|
+
//Create a define function specific to the module asking for amdefine.
|
137
|
+
function define() {
|
138
|
+
|
139
|
+
var args = arguments,
|
140
|
+
factory = args[args.length - 1],
|
141
|
+
isFactoryFunction = (typeof factory === 'function'),
|
142
|
+
deps, result;
|
143
|
+
|
144
|
+
//Only support one define call per file
|
145
|
+
if (alreadyCalled) {
|
146
|
+
throw new Error('amdefine cannot be called more than once per file.');
|
147
|
+
}
|
148
|
+
alreadyCalled = true;
|
149
|
+
|
150
|
+
//Grab array of dependencies if it is there.
|
151
|
+
if (args.length > 1) {
|
152
|
+
deps = args[args.length - 2];
|
153
|
+
if (!Array.isArray(deps)) {
|
154
|
+
//deps is not an array, may be an ID. Discard it.
|
155
|
+
deps = null;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
//If there are dependencies, they are strings, so need
|
160
|
+
//to convert them to dependency values.
|
161
|
+
if (deps) {
|
162
|
+
deps = deps.map(function (depName) {
|
163
|
+
return stringRequire(module, depName);
|
164
|
+
});
|
165
|
+
} else if (isFactoryFunction) {
|
166
|
+
//Pass in the standard require, exports, module
|
167
|
+
deps = [makeRequire(module), module.exports, module];
|
168
|
+
}
|
169
|
+
|
170
|
+
if (!isFactoryFunction) {
|
171
|
+
//Factory is an object that should just be used for the define call.
|
172
|
+
module.exports = factory;
|
173
|
+
} else {
|
174
|
+
//Call the factory with the right dependencies.
|
175
|
+
result = factory.apply(module.exports, deps);
|
176
|
+
|
177
|
+
if (result !== undefined) {
|
178
|
+
module.exports = result;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
define.amd = {};
|
184
|
+
|
185
|
+
return define;
|
186
|
+
}
|
187
|
+
|
188
|
+
module.exports = amdefine;
|
data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "amdefine",
|
3
|
+
"description": "Provide AMD's define() API for declaring modules in the AMD format",
|
4
|
+
"version": "0.0.1",
|
5
|
+
"homepage": "http://github.com/jrburke/amdefine.js",
|
6
|
+
"author": "James Burke <jrburke@gmail.com> (http://github.com/jrburke)",
|
7
|
+
"licenses": [
|
8
|
+
{
|
9
|
+
"type": "BSD",
|
10
|
+
"url": "https://github.com/jrburke/amdefine/blob/master/LICENSE"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"type": "MIT",
|
14
|
+
"url": "https://github.com/jrburke/amdefine/blob/master/LICENSE"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"main": "./amdefine.js",
|
18
|
+
"engines": {
|
19
|
+
"node": ">=0.6.0"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/*!
|
2
|
+
* this is a BANG LICENSE COMMENT
|
3
|
+
*/
|
4
|
+
/** vim: et:ts=4:sw=4:sts=4
|
5
|
+
* @license This is a LICENSE COMMENT that should be preserved.
|
6
|
+
* Available via the MIT or new BSD license.
|
7
|
+
* see: http://example.com/license for details
|
8
|
+
*/
|
9
|
+
define("bang",[],function(){return{name:"bang"}}),define("license",{name:"license"})
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/** vim: et:ts=4:sw=4:sts=4
|
2
|
+
* @license This is a LICENSE COMMENT that should be preserved.
|
3
|
+
* Available via the MIT or new BSD license.
|
4
|
+
* see: http://example.com/license for details
|
5
|
+
*/
|
6
|
+
|
7
|
+
define({
|
8
|
+
//@license comment to be IGNORED
|
9
|
+
name: 'license'
|
10
|
+
/**
|
11
|
+
* A license fake-out, should be IGNORED
|
12
|
+
*/
|
13
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
require(['sub1'], function () {});
|
@@ -0,0 +1 @@
|
|
1
|
+
define(['empty1'], function () {});
|
@@ -0,0 +1 @@
|
|
1
|
+
define(['empty2'], function () {});
|
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
(function (define) {
|
3
|
+
foo.define('modules/one',[],function ( ){
|
4
|
+
return { name: 'one' };
|
5
|
+
});
|
6
|
+
|
7
|
+
}(typeof foo.define === 'function' && foo.define.amd ? foo.define : function () {
|
8
|
+
|
9
|
+
|
10
|
+
}));
|
11
|
+
|
12
|
+
if (typeof foo.define === 'function' && foo.define.amd && foo.define.jQuery) {
|
13
|
+
foo.define('modules/two',[],function () {
|
14
|
+
return { name: 'two' };
|
15
|
+
});
|
16
|
+
}
|
17
|
+
;
|
18
|
+
if(false){
|
19
|
+
|
20
|
+
}else if(typeof foo.define === 'function' && typeof foo.define.amd === 'object' && foo.define.amd){
|
21
|
+
foo.define('modules/four',{
|
22
|
+
name: 'four'
|
23
|
+
});
|
24
|
+
};
|
25
|
+
(function (define) {
|
26
|
+
foo.define('modules/three',[], function (require) {
|
27
|
+
//If have dependencies, get them here
|
28
|
+
var four = foo.require('./four');
|
29
|
+
|
30
|
+
//Return the module definition.
|
31
|
+
return {
|
32
|
+
name: 'three',
|
33
|
+
fourName: four.name
|
34
|
+
};
|
35
|
+
});
|
36
|
+
}(typeof foo.define === 'function' && foo.define.amd ? foo.define : function (id, factory) {
|
37
|
+
|
38
|
+
}));
|
39
|
+
|
40
|
+
foo.require(['modules/one', 'modules/two', 'modules/three'], function (one, two, three) {
|
41
|
+
console.log("One's name is: " + one.name);
|
42
|
+
console.log("Two's name is: " + two.name);
|
43
|
+
console.log("Two's name is: " + three.name);
|
44
|
+
console.log("Three's fourName is: " + three.fourName);
|
45
|
+
});
|
46
|
+
|
47
|
+
foo.define("main", function(){});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
require(['modules/one', 'modules/two', 'modules/three'], function (one, two, three) {
|
2
|
+
console.log("One's name is: " + one.name);
|
3
|
+
console.log("Two's name is: " + two.name);
|
4
|
+
console.log("Two's name is: " + three.name);
|
5
|
+
console.log("Three's fourName is: " + three.fourName);
|
6
|
+
});
|