Skip to content

Commit ccaefbf

Browse files
committed
merge updates to master this is the new Hem! 1.0 is coming baby!
1 parent 06fb42d commit ccaefbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+32068
-1246
lines changed

README.md

+159-104
Large diffs are not rendered by default.

assets/defaults/spine.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"root": "",
3+
"route": "/",
4+
5+
"version": {
6+
"type": "package",
7+
"files": [ "public/index.html" ]
8+
},
9+
10+
"css": {
11+
"src": [
12+
"css"
13+
],
14+
"target": "public/application.css"
15+
},
16+
17+
"js": {
18+
"commonjs": "require",
19+
"libs": [
20+
"lib"
21+
],
22+
"modules": [
23+
"jqueryify",
24+
"spine",
25+
"spine/lib/local",
26+
"spine/lib/list",
27+
"spine/lib/ajax",
28+
"spine/lib/route",
29+
"spine/lib/manager",
30+
"spine/lib/relation"
31+
],
32+
"src": [
33+
"app"
34+
],
35+
"target": "public/application.js"
36+
},
37+
38+
"static": {
39+
"/": "public",
40+
"/test": "test/public"
41+
},
42+
43+
"test": {
44+
"commonjs": "specs",
45+
"libs": [],
46+
"depends": [],
47+
"src": [
48+
"test/specs"
49+
],
50+
"target": "test/public/specs.js"
51+
}
52+
}
53+

assets/stitch.tmpl

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
(function(/*! Stitch !*/) {
2+
if (!this.<%=identifier%>) {
3+
var modules = {}, cache = {}, require = function(name, root) {
4+
var path = expand(root, name), indexPath = expand(path, './index'), module, fn;
5+
module = cache[path] || cache[indexPath]
6+
if (module) {
7+
return module.exports;
8+
} else if (fn = modules[path] || modules[path = indexPath]) {
9+
module = {id: path, exports: {}};
10+
try {
11+
cache[path] = module;
12+
fn(module.exports, function(name) {
13+
return require(name, dirname(path));
14+
}, module);
15+
return module.exports;
16+
} catch (err) {
17+
delete cache[path];
18+
throw err;
19+
}
20+
} else {
21+
throw 'module ' + name + ' not found';
22+
}
23+
}, expand = function(root, name) {
24+
var results = [], parts, part;
25+
if (/^\.\.?(\\/|$)/.test(name)) {
26+
parts = [root, name].join('/').split('/');
27+
} else {
28+
parts = name.split('/');
29+
}
30+
for (var i = 0, length = parts.length; i < length; i++) {
31+
part = parts[i];
32+
if (part == '..') {
33+
results.pop();
34+
} else if (part != '.' && part != '') {
35+
results.push(part);
36+
}
37+
}
38+
return results.join('/');
39+
}, dirname = function(path) {
40+
return path.split('/').slice(0, -1).join('/');
41+
};
42+
this.<%=identifier%> = function(name) {
43+
return require(name, '');
44+
}
45+
this.<%=identifier%>.define = function(bundle) {
46+
for (var key in bundle)
47+
modules[key] = bundle[key];
48+
};
49+
this.<%=identifier%>.modules = modules;
50+
this.<%=identifier%>.cache = cache;
51+
}
52+
return this.<%=identifier%>.define;
53+
}).call(this)({
54+
<%
55+
var output = [];
56+
for (var i = 0; i < modules.length; i++) {
57+
output.push(JSON.stringify(modules[i].id) + ": function(exports, require, module) { " + modules[i].compile() + " }" );
58+
}
59+
%>
60+
<%= output.join(',') %>
61+
});
62+

assets/testacular.conf.js

-62
This file was deleted.

assets/testing/index.tmpl

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf8" />
5+
<title>Hem Test Runner</title>
6+
</head>
7+
<body>
8+
9+
<script type="text/javascript">
10+
(function() {
11+
12+
function startTests() {
13+
14+
// create jasmine environment
15+
var jasmineEnv = jasmine.getEnv();
16+
jasmineEnv.updateInterval = 250;
17+
18+
/**
19+
Create the `HTMLReporter`, which Jasmine calls to provide results of each spec
20+
and each suite. The Reporter is responsible for presenting results to the user.
21+
*/
22+
var htmlReporter = new jasmine.HtmlReporter();
23+
jasmineEnv.addReporter(htmlReporter);
24+
25+
/**
26+
Delegate filtering of specs to the reporter. Allows for clicking on single suites
27+
or specs in the results to only run a subset of the suite.
28+
*/
29+
jasmineEnv.specFilter = function(spec) {
30+
return htmlReporter.specFilter(spec);
31+
};
32+
33+
jasmineEnv.execute();
34+
}
35+
36+
window.onload = function() {
37+
var http = (location.protocol === "http:")
38+
var urlsToLoad = []
39+
var filesToLoad = []
40+
41+
// files to load
42+
<% for (var i = 0; i < files.length; i++) { %>
43+
urlsToLoad.push("<%= files[i].url %>")
44+
filesToLoad.push("<%= files[i].path %>")
45+
<% } %>
46+
47+
// determine if using http to load files
48+
var files = http ? urlsToLoad : filesToLoad
49+
50+
// function to create elements to load css/js
51+
var loadCssOrScript = function(position) {
52+
// start tests if everything loaded
53+
if (position >= files.length) {
54+
startTests();
55+
return;
56+
}
57+
58+
// create document elements
59+
var head = document.getElementsByTagName("HEAD").item(0);
60+
var child;
61+
var source = files[position];
62+
63+
// handle js
64+
if (source.indexOf(".js") > -1) {
65+
66+
child = document.createElement("script");
67+
child.type = "text/javascript";
68+
child.src = source;
69+
70+
// handle css
71+
} else {
72+
// skip css files for phantomjs
73+
if (navigator.userAgent.indexOf("PhantomJS") > -1) {
74+
loadCssOrScript(++position);
75+
return
76+
}
77+
child = document.createElement("link");
78+
child.setAttribute("rel", "stylesheet")
79+
child.type = "text/css";
80+
child.href = source;
81+
}
82+
83+
// handle next call
84+
child.onload = function() {
85+
loadCssOrScript(++position);
86+
}
87+
88+
// add child to document to load
89+
head.appendChild(child);
90+
91+
}
92+
93+
// dynamically load application and specs javascript files
94+
loadCssOrScript(0)
95+
};
96+
97+
98+
})();
99+
</script>
100+
</body>
101+
</html>

0 commit comments

Comments
 (0)