bpm 1.0.0.beta.4 → 1.0.0.beta.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +11 -0
- data/TODO.md +4 -10
- data/backbone/LICENSE +22 -0
- data/backbone/README +25 -0
- data/backbone/Rakefile +42 -0
- data/backbone/backbone-0.5.1.bpkg +0 -0
- data/backbone/examples/backbone-localstorage.js +84 -0
- data/backbone/examples/todos/destroy.png +0 -0
- data/backbone/examples/todos/index.html +87 -0
- data/backbone/examples/todos/todos.css +311 -0
- data/backbone/examples/todos/todos.js +258 -0
- data/backbone/index.html +2606 -0
- data/backbone/index.js +1 -0
- data/backbone/lib/backbone.js +1149 -0
- data/backbone/lib/index.js +1 -0
- data/backbone/package.json +14 -0
- data/backbone/test/collection.js +345 -0
- data/backbone/test/events.js +70 -0
- data/backbone/test/model.coffee +43 -0
- data/backbone/test/model.js +424 -0
- data/backbone/test/noconflict.js +12 -0
- data/backbone/test/router.js +116 -0
- data/backbone/test/speed.js +45 -0
- data/backbone/test/sync.js +133 -0
- data/backbone/test/test-zepto.html +30 -0
- data/backbone/test/test.html +31 -0
- data/backbone/test/vendor/jquery-1.5.js +8176 -0
- data/backbone/test/vendor/jslitmus.js +649 -0
- data/backbone/test/vendor/json2.js +481 -0
- data/backbone/test/vendor/qunit.css +196 -0
- data/backbone/test/vendor/qunit.js +1364 -0
- data/backbone/test/vendor/underscore-1.1.6.js +807 -0
- data/backbone/test/vendor/zepto-0.6.js +692 -0
- data/backbone/test/view.js +137 -0
- data/lib/bpm/cli/base.rb +22 -7
- data/lib/bpm/package.rb +17 -5
- data/lib/bpm/project.rb +49 -32
- data/lib/bpm/version.rb +1 -1
- data/spec/cli/add_spec.rb +22 -4
- data/spec/cli/fetch_spec.rb +0 -1
- data/spec/cli/init_spec.rb +25 -10
- data/spec/cli/list_spec.rb +103 -62
- data/spec/cli/pack_spec.rb +36 -4
- data/spec/fixtures/packages/backbone/LICENSE +22 -0
- data/spec/fixtures/packages/backbone/README +25 -0
- data/spec/fixtures/packages/backbone/Rakefile +42 -0
- data/spec/fixtures/packages/backbone/examples/backbone-localstorage.js +84 -0
- data/spec/fixtures/packages/backbone/examples/todos/destroy.png +0 -0
- data/spec/fixtures/packages/backbone/examples/todos/index.html +87 -0
- data/spec/fixtures/packages/backbone/examples/todos/todos.css +311 -0
- data/spec/fixtures/packages/backbone/examples/todos/todos.js +258 -0
- data/spec/fixtures/packages/backbone/index.html +2606 -0
- data/spec/fixtures/packages/backbone/lib/backbone.js +1149 -0
- data/spec/fixtures/packages/backbone/lib/index.js +1 -0
- data/spec/fixtures/packages/backbone/package.json +14 -0
- data/spec/fixtures/packages/backbone/test/collection.js +345 -0
- data/spec/fixtures/packages/backbone/test/events.js +70 -0
- data/spec/fixtures/packages/backbone/test/model.coffee +43 -0
- data/spec/fixtures/packages/backbone/test/model.js +424 -0
- data/spec/fixtures/packages/backbone/test/noconflict.js +12 -0
- data/spec/fixtures/packages/backbone/test/router.js +116 -0
- data/spec/fixtures/packages/backbone/test/speed.js +45 -0
- data/spec/fixtures/packages/backbone/test/sync.js +133 -0
- data/spec/fixtures/packages/backbone/test/test-zepto.html +30 -0
- data/spec/fixtures/packages/backbone/test/test.html +31 -0
- data/spec/fixtures/packages/backbone/test/vendor/jquery-1.5.js +8176 -0
- data/spec/fixtures/packages/backbone/test/vendor/jslitmus.js +649 -0
- data/spec/fixtures/packages/backbone/test/vendor/json2.js +481 -0
- data/spec/fixtures/packages/backbone/test/vendor/qunit.css +196 -0
- data/spec/fixtures/packages/backbone/test/vendor/qunit.js +1364 -0
- data/spec/fixtures/packages/backbone/test/vendor/underscore-1.1.6.js +807 -0
- data/spec/fixtures/packages/backbone/test/vendor/zepto-0.6.js +692 -0
- data/spec/fixtures/packages/backbone/test/view.js +137 -0
- data/spec/fixtures/projects/init_app/assets/bpm_libs.js +1 -1
- data/spec/fixtures/projects/init_app/assets/bpm_styles.css +1 -1
- data/spec/fixtures/projects/init_app/new_project.json +1 -10
- data/spec/pipeline_spec.rb +5 -5
- data/spec/plugins/minifier_spec.rb +1 -1
- data/spec/plugins/transport_spec.rb +1 -1
- metadata +116 -28
- data/spec/fixtures/projects/init_app/assets/new_project/bpm_libs.js +0 -6
- data/spec/fixtures/projects/init_app/assets/new_project/bpm_styles.css +0 -5
@@ -0,0 +1,133 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
|
3
|
+
module("Backbone.sync", {setup : function() {
|
4
|
+
window.lastRequest = null;
|
5
|
+
$.ajax = function(obj) {
|
6
|
+
lastRequest = obj;
|
7
|
+
};
|
8
|
+
}});
|
9
|
+
|
10
|
+
var Library = Backbone.Collection.extend({
|
11
|
+
url : function() { return '/library'; }
|
12
|
+
});
|
13
|
+
|
14
|
+
var library = new Library();
|
15
|
+
|
16
|
+
var attrs = {
|
17
|
+
title : "The Tempest",
|
18
|
+
author : "Bill Shakespeare",
|
19
|
+
length : 123
|
20
|
+
};
|
21
|
+
|
22
|
+
test("sync: read", function() {
|
23
|
+
Backbone.sync = originalSync;
|
24
|
+
library.fetch();
|
25
|
+
equals(lastRequest.url, '/library');
|
26
|
+
equals(lastRequest.type, 'GET');
|
27
|
+
equals(lastRequest.dataType, 'json');
|
28
|
+
ok(_.isEmpty(lastRequest.data));
|
29
|
+
});
|
30
|
+
|
31
|
+
test("sync: passing data", function() {
|
32
|
+
library.fetch({data: {a: 'a', one: 1}});
|
33
|
+
equals(lastRequest.url, '/library');
|
34
|
+
equals(lastRequest.data.a, 'a');
|
35
|
+
equals(lastRequest.data.one, 1);
|
36
|
+
});
|
37
|
+
|
38
|
+
test("sync: create", function() {
|
39
|
+
library.add(library.create(attrs));
|
40
|
+
equals(lastRequest.url, '/library');
|
41
|
+
equals(lastRequest.type, 'POST');
|
42
|
+
equals(lastRequest.dataType, 'json');
|
43
|
+
var data = JSON.parse(lastRequest.data);
|
44
|
+
equals(data.title, 'The Tempest');
|
45
|
+
equals(data.author, 'Bill Shakespeare');
|
46
|
+
equals(data.length, 123);
|
47
|
+
});
|
48
|
+
|
49
|
+
test("sync: update", function() {
|
50
|
+
library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
|
51
|
+
equals(lastRequest.url, '/library/1-the-tempest');
|
52
|
+
equals(lastRequest.type, 'PUT');
|
53
|
+
equals(lastRequest.dataType, 'json');
|
54
|
+
var data = JSON.parse(lastRequest.data);
|
55
|
+
equals(data.id, '1-the-tempest');
|
56
|
+
equals(data.title, 'The Tempest');
|
57
|
+
equals(data.author, 'William Shakespeare');
|
58
|
+
equals(data.length, 123);
|
59
|
+
});
|
60
|
+
|
61
|
+
test("sync: update with emulateHTTP and emulateJSON", function() {
|
62
|
+
Backbone.emulateHTTP = Backbone.emulateJSON = true;
|
63
|
+
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
64
|
+
equals(lastRequest.url, '/library/2-the-tempest');
|
65
|
+
equals(lastRequest.type, 'POST');
|
66
|
+
equals(lastRequest.dataType, 'json');
|
67
|
+
equals(lastRequest.data._method, 'PUT');
|
68
|
+
var data = JSON.parse(lastRequest.data.model);
|
69
|
+
equals(data.id, '2-the-tempest');
|
70
|
+
equals(data.author, 'Tim Shakespeare');
|
71
|
+
equals(data.length, 123);
|
72
|
+
Backbone.emulateHTTP = Backbone.emulateJSON = false;
|
73
|
+
});
|
74
|
+
|
75
|
+
test("sync: update with just emulateHTTP", function() {
|
76
|
+
Backbone.emulateHTTP = true;
|
77
|
+
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
78
|
+
equals(lastRequest.url, '/library/2-the-tempest');
|
79
|
+
equals(lastRequest.type, 'POST');
|
80
|
+
equals(lastRequest.contentType, 'application/json');
|
81
|
+
var data = JSON.parse(lastRequest.data);
|
82
|
+
equals(data.id, '2-the-tempest');
|
83
|
+
equals(data.author, 'Tim Shakespeare');
|
84
|
+
equals(data.length, 123);
|
85
|
+
Backbone.emulateHTTP = false;
|
86
|
+
});
|
87
|
+
|
88
|
+
test("sync: update with just emulateJSON", function() {
|
89
|
+
Backbone.emulateJSON = true;
|
90
|
+
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
91
|
+
equals(lastRequest.url, '/library/2-the-tempest');
|
92
|
+
equals(lastRequest.type, 'PUT');
|
93
|
+
equals(lastRequest.contentType, 'application/x-www-form-urlencoded');
|
94
|
+
var data = JSON.parse(lastRequest.data.model);
|
95
|
+
equals(data.id, '2-the-tempest');
|
96
|
+
equals(data.author, 'Tim Shakespeare');
|
97
|
+
equals(data.length, 123);
|
98
|
+
Backbone.emulateJSON = false;
|
99
|
+
});
|
100
|
+
|
101
|
+
test("sync: read model", function() {
|
102
|
+
library.first().fetch();
|
103
|
+
equals(lastRequest.url, '/library/2-the-tempest');
|
104
|
+
equals(lastRequest.type, 'GET');
|
105
|
+
ok(_.isEmpty(lastRequest.data));
|
106
|
+
});
|
107
|
+
|
108
|
+
test("sync: destroy", function() {
|
109
|
+
library.first().destroy();
|
110
|
+
equals(lastRequest.url, '/library/2-the-tempest');
|
111
|
+
equals(lastRequest.type, 'DELETE');
|
112
|
+
equals(lastRequest.data, null);
|
113
|
+
});
|
114
|
+
|
115
|
+
test("sync: destroy with emulateHTTP", function() {
|
116
|
+
Backbone.emulateHTTP = Backbone.emulateJSON = true;
|
117
|
+
library.first().destroy();
|
118
|
+
equals(lastRequest.url, '/library/2-the-tempest');
|
119
|
+
equals(lastRequest.type, 'POST');
|
120
|
+
equals(JSON.stringify(lastRequest.data), '{"_method":"DELETE"}');
|
121
|
+
Backbone.emulateHTTP = Backbone.emulateJSON = false;
|
122
|
+
});
|
123
|
+
|
124
|
+
test("sync: urlError", function() {
|
125
|
+
model = new Backbone.Model();
|
126
|
+
raises(function() {
|
127
|
+
model.fetch();
|
128
|
+
});
|
129
|
+
model.fetch({url: '/one/two'});
|
130
|
+
equals(lastRequest.url, '/one/two');
|
131
|
+
});
|
132
|
+
|
133
|
+
});
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Backbone Test Suite</title>
|
5
|
+
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
|
6
|
+
<script type="text/javascript" src="vendor/json2.js"></script>
|
7
|
+
<script type="text/javascript" src="vendor/zepto-0.6.js"></script>
|
8
|
+
<script type="text/javascript" src="vendor/qunit.js"></script>
|
9
|
+
<script type="text/javascript" src="vendor/jslitmus.js"></script>
|
10
|
+
<script type="text/javascript" src="vendor/underscore-1.1.6.js"></script>
|
11
|
+
<script type="text/javascript" src="../backbone.js"></script>
|
12
|
+
|
13
|
+
<script type="text/javascript" src="events.js"></script>
|
14
|
+
<script type="text/javascript" src="model.js"></script>
|
15
|
+
<script type="text/javascript" src="collection.js"></script>
|
16
|
+
<script type="text/javascript" src="router.js"></script>
|
17
|
+
<script type="text/javascript" src="view.js"></script>
|
18
|
+
<script type="text/javascript" src="sync.js"></script>
|
19
|
+
<script type="text/javascript" src="speed.js"></script>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<h1 id="qunit-header">Backbone Test Suite</h1>
|
23
|
+
<h2 id="qunit-banner"></h2>
|
24
|
+
<h2 id="qunit-userAgent"></h2>
|
25
|
+
<ol id="qunit-tests"></ol>
|
26
|
+
<br /><br />
|
27
|
+
<h1 id="qunit-header"><a href="#">Backbone Speed Suite</a></h1>
|
28
|
+
<div id="jslitmus_container" style="margin: 20px 10px;"></div>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Backbone Test Suite</title>
|
5
|
+
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
|
6
|
+
<script type="text/javascript" src="vendor/json2.js"></script>
|
7
|
+
<script type="text/javascript" src="vendor/jquery-1.5.js"></script>
|
8
|
+
<script type="text/javascript" src="vendor/qunit.js"></script>
|
9
|
+
<script type="text/javascript" src="vendor/jslitmus.js"></script>
|
10
|
+
<script type="text/javascript" src="vendor/underscore-1.1.6.js"></script>
|
11
|
+
<script type="text/javascript" src="../backbone.js"></script>
|
12
|
+
|
13
|
+
<script type="text/javascript" src="noconflict.js"></script>
|
14
|
+
<script type="text/javascript" src="events.js"></script>
|
15
|
+
<script type="text/javascript" src="model.js"></script>
|
16
|
+
<script type="text/javascript" src="collection.js"></script>
|
17
|
+
<script type="text/javascript" src="router.js"></script>
|
18
|
+
<script type="text/javascript" src="view.js"></script>
|
19
|
+
<script type="text/javascript" src="sync.js"></script>
|
20
|
+
<script type="text/javascript" src="speed.js"></script>
|
21
|
+
</head>
|
22
|
+
<body>
|
23
|
+
<h1 id="qunit-header">Backbone Test Suite</h1>
|
24
|
+
<h2 id="qunit-banner"></h2>
|
25
|
+
<h2 id="qunit-userAgent"></h2>
|
26
|
+
<ol id="qunit-tests"></ol>
|
27
|
+
<br /><br />
|
28
|
+
<h1 id="qunit-header"><a href="#">Backbone Speed Suite</a></h1>
|
29
|
+
<div id="jslitmus_container" style="margin: 20px 10px;"></div>
|
30
|
+
</body>
|
31
|
+
</html>
|