sproutcore 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +123 -1
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +13 -9
- data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +68 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +59 -60
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +6 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/locale.js +48 -29
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/selection_set/remove.js +53 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroy.js +34 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js +47 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +31 -36
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +10 -10
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +55 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +5 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +105 -105
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +131 -30
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +9 -5
- data/lib/sproutcore/helpers/minifier.rb +0 -2
- data/lib/sproutcore/rack/filesystem.rb +5 -5
- metadata +3 -2
data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
// Copyright: ©2006-2011 Apple Inc. and contributors.
|
4
4
|
// License: Licensed under MIT license (see license.js)
|
5
5
|
// ==========================================================================
|
6
|
-
/*globals module ok equals same test
|
6
|
+
/*globals module, ok, equals, same, test */
|
7
7
|
|
8
8
|
// NOTE: The test below are based on the Data Hashes state chart. This models
|
9
9
|
// the "commit" event in the NestedStore portion of the diagram.
|
@@ -14,29 +14,29 @@ module("SC.NestedStore#commitChanges", {
|
|
14
14
|
SC.RunLoop.begin();
|
15
15
|
|
16
16
|
parent = SC.Store.create();
|
17
|
-
|
17
|
+
|
18
18
|
json = {
|
19
19
|
string: "string",
|
20
20
|
number: 23,
|
21
21
|
bool: YES
|
22
22
|
};
|
23
23
|
args = [];
|
24
|
-
|
24
|
+
|
25
25
|
storeKey = SC.Store.generateStoreKey();
|
26
26
|
|
27
27
|
store = parent.chain(); // create nested store
|
28
28
|
child = store.chain(); // test multiple levels deep
|
29
|
-
|
29
|
+
|
30
30
|
// override commitChangesFromNestedStore() so we can ensure it is called
|
31
31
|
// save call history for later evaluation
|
32
32
|
parent.commitChangesFromNestedStore =
|
33
33
|
child.commitChangesFromNestedStore =
|
34
34
|
store.commitChangesFromNestedStore = function(store, changes, force) {
|
35
|
-
args.push({
|
36
|
-
target: this,
|
37
|
-
store: store,
|
38
|
-
changes: changes,
|
39
|
-
force: force
|
35
|
+
args.push({
|
36
|
+
target: this,
|
37
|
+
store: store,
|
38
|
+
changes: changes,
|
39
|
+
force: force
|
40
40
|
});
|
41
41
|
};
|
42
42
|
|
@@ -52,12 +52,12 @@ function testStateTransition(shouldIncludeStoreKey, shouldCallParent) {
|
|
52
52
|
|
53
53
|
// attempt to commit
|
54
54
|
equals(store.commitChanges(), store, 'should return receiver');
|
55
|
-
|
55
|
+
|
56
56
|
// verify result
|
57
57
|
equals(store.storeKeyEditState(storeKey), SC.Store.INHERITED, 'data edit state');
|
58
58
|
|
59
59
|
if (shouldCallParent === NO) {
|
60
|
-
ok(!args || args.length===0, 'should not call commitChangesFromNestedStore');
|
60
|
+
ok(!args || args.length===0, 'should not call commitChangesFromNestedStore');
|
61
61
|
} else {
|
62
62
|
equals(args.length, 1, 'should have called commitChangesFromNestedStore');
|
63
63
|
|
@@ -73,7 +73,7 @@ function testStateTransition(shouldIncludeStoreKey, shouldCallParent) {
|
|
73
73
|
ok(!didInclude, 'passed set of changes should NOT include storeKey');
|
74
74
|
}
|
75
75
|
}
|
76
|
-
|
76
|
+
|
77
77
|
equals(store.get('hasChanges'), NO, 'hasChanges should be cleared');
|
78
78
|
ok(!store.chainedChanges || store.chainedChanges.length===0, 'should have empty chainedChanges set');
|
79
79
|
}
|
@@ -82,7 +82,7 @@ test("state = INHERITED", function() {
|
|
82
82
|
|
83
83
|
// write in some data to parent
|
84
84
|
parent.writeDataHash(storeKey, json);
|
85
|
-
|
85
|
+
|
86
86
|
// check preconditions
|
87
87
|
equals(store.storeKeyEditState(storeKey), SC.Store.INHERITED, 'precond - data edit state');
|
88
88
|
|
@@ -91,12 +91,12 @@ test("state = INHERITED", function() {
|
|
91
91
|
|
92
92
|
|
93
93
|
test("state = LOCKED", function() {
|
94
|
-
|
94
|
+
|
95
95
|
// write in some data to parent
|
96
96
|
parent.writeDataHash(storeKey, json);
|
97
97
|
parent.editables = null ; // manually force to lock state
|
98
98
|
store.readDataHash(storeKey);
|
99
|
-
|
99
|
+
|
100
100
|
// check preconditions
|
101
101
|
equals(store.storeKeyEditState(storeKey), SC.Store.LOCKED, 'precond - data edit state');
|
102
102
|
ok(!store.chainedChanges || !store.chainedChanges.contains(storeKey), 'locked record should not be in chainedChanges set');
|
@@ -105,11 +105,11 @@ test("state = LOCKED", function() {
|
|
105
105
|
});
|
106
106
|
|
107
107
|
test("state = EDITABLE", function() {
|
108
|
-
|
108
|
+
|
109
109
|
// write in some data to parent
|
110
110
|
store.writeDataHash(storeKey, json);
|
111
111
|
store.dataHashDidChange(storeKey);
|
112
|
-
|
112
|
+
|
113
113
|
// check preconditions
|
114
114
|
equals(store.storeKeyEditState(storeKey), SC.Store.EDITABLE, 'precond - data edit state');
|
115
115
|
ok(store.chainedChanges && store.chainedChanges.contains(storeKey), 'editable record should be in chainedChanges set');
|
@@ -125,49 +125,150 @@ test("state = EDITABLE", function() {
|
|
125
125
|
test("commiting a changed record should immediately notify outstanding records in parent store", function() {
|
126
126
|
|
127
127
|
var Rec = SC.Record.extend({
|
128
|
-
|
128
|
+
|
129
129
|
fooCnt: 0,
|
130
130
|
fooDidChange: function() { this.fooCnt++; }.observes('foo'),
|
131
|
-
|
131
|
+
|
132
132
|
statusCnt: 0,
|
133
133
|
statusDidChange: function() { this.statusCnt++; }.observes('status'),
|
134
|
-
|
134
|
+
|
135
135
|
reset: function() { this.fooCnt = this.statusCnt = 0; },
|
136
|
-
|
136
|
+
|
137
137
|
equals: function(fooCnt, statusCnt, str) {
|
138
138
|
if (!str) str = '' ;
|
139
139
|
equals(this.get('fooCnt'), fooCnt, str + ':fooCnt');
|
140
140
|
equals(this.get('statusCnt'), statusCnt, str + ':statusCnt');
|
141
141
|
}
|
142
|
-
|
142
|
+
|
143
143
|
});
|
144
144
|
|
145
145
|
SC.RunLoop.begin();
|
146
|
-
|
146
|
+
|
147
147
|
var store = SC.Store.create();
|
148
148
|
var prec = store.createRecord(Rec, { foo: "bar", guid: 1 });
|
149
|
-
|
149
|
+
|
150
150
|
var child = store.chain();
|
151
151
|
var crec = child.find(Rec, prec.get('id'));
|
152
|
-
|
152
|
+
|
153
153
|
// check assumptions
|
154
154
|
ok(!!crec, 'prerec - should find child record');
|
155
155
|
equals(crec.get('foo'), 'bar', 'prerec - child record should have foo');
|
156
|
-
|
156
|
+
|
157
157
|
// modify child record - should not modify parent
|
158
158
|
prec.reset();
|
159
159
|
crec.set('foo', 'baz');
|
160
160
|
equals(prec.get('foo'), 'bar', 'should not modify parent before commit');
|
161
161
|
prec.equals(0,0, 'before commitChanges');
|
162
|
-
|
162
|
+
|
163
163
|
// commit changes - note: still inside runloop
|
164
164
|
child.commitChanges();
|
165
165
|
equals(prec.get('foo'), 'baz', 'should push data to parent');
|
166
166
|
prec.equals(1,1, 'after commitChanges'); // should notify immediately
|
167
|
-
|
167
|
+
|
168
168
|
SC.RunLoop.end();
|
169
|
-
|
169
|
+
|
170
170
|
// should not notify again after runloop - nothing to do
|
171
171
|
prec.equals(1,1,'after runloop ends - should not notify again');
|
172
|
-
|
172
|
+
|
173
|
+
});
|
174
|
+
|
175
|
+
|
176
|
+
test("Changes to relationships should propagate to the parent store.", function() {
|
177
|
+
|
178
|
+
var MyApp = window.MyApp = SC.Object.create({
|
179
|
+
store: SC.Store.create()
|
180
|
+
});
|
181
|
+
|
182
|
+
MyApp.Rec = SC.Record.extend({
|
183
|
+
relatedChild: SC.Record.toOne('MyApp.RelatedRec', {
|
184
|
+
inverse: 'relatedParent'
|
185
|
+
}),
|
186
|
+
|
187
|
+
relatedChildren: SC.Record.toMany('MyApp.RelatedRecs', {
|
188
|
+
inverse: 'relatedParent'
|
189
|
+
})
|
190
|
+
});
|
191
|
+
|
192
|
+
MyApp.RelatedRec = SC.Record.extend({
|
193
|
+
relatedParent: SC.Record.toOne('MyApp.Rec', {
|
194
|
+
inverse: 'relatedChild',
|
195
|
+
isMaster: NO
|
196
|
+
})
|
197
|
+
});
|
198
|
+
|
199
|
+
MyApp.RelatedRecs = SC.Record.extend({
|
200
|
+
relatedParent: SC.Record.toOne('MyApp.Rec', {
|
201
|
+
inverse: 'relatedChildren',
|
202
|
+
isMaster: NO
|
203
|
+
})
|
204
|
+
});
|
205
|
+
|
206
|
+
SC.RunLoop.begin();
|
207
|
+
|
208
|
+
MyApp.store.loadRecord(MyApp.RelatedRec, { guid: 2, relatedParent: 1});
|
209
|
+
MyApp.store.loadRecord(MyApp.RelatedRecs, { guid: 3, relatedParent: 1 });
|
210
|
+
MyApp.store.loadRecord(MyApp.RelatedRecs, { guid: 4, relatedParent: 1 });
|
211
|
+
MyApp.store.loadRecord(MyApp.Rec, { guid: 1, relatedChild: 2, relatedChildren: [3,4] });
|
212
|
+
|
213
|
+
var primaryRec = MyApp.store.find(MyApp.Rec, 1);
|
214
|
+
var primaryRelatedRec = MyApp.store.find(MyApp.RelatedRec, 2);
|
215
|
+
var primaryRelatedRecs1 = MyApp.store.find(MyApp.RelatedRecs, 3);
|
216
|
+
var primaryRelatedRecs2 = MyApp.store.find(MyApp.RelatedRecs, 4);
|
217
|
+
|
218
|
+
var nestedStore = MyApp.store.chain();
|
219
|
+
var nestedRec = nestedStore.find(MyApp.Rec, primaryRec.get('id'));
|
220
|
+
var nestedRelatedRec = nestedStore.find(MyApp.RelatedRec, primaryRelatedRec.get('id'));
|
221
|
+
var nestedRelatedRecs1 = nestedStore.find(MyApp.RelatedRecs, primaryRelatedRecs1.get('id'));
|
222
|
+
var nestedRelatedRecs2 = nestedStore.find(MyApp.RelatedRecs, primaryRelatedRecs2.get('id'));
|
223
|
+
|
224
|
+
// check assumptions
|
225
|
+
ok(!!nestedRec, 'Prior to nested changes should find primaryRec in nested store');
|
226
|
+
ok(!!nestedRelatedRec, 'Prior to nested changes should find nestedRelatedRec in nested store');
|
227
|
+
ok(!!nestedRelatedRecs1, 'Prior to nested changes should find nestedRelatedRecs1 in nested store');
|
228
|
+
ok(!!nestedRelatedRecs2, 'Prior to nested changes should find nestedRelatedRecs2 in nested store');
|
229
|
+
equals(primaryRec.get('relatedChild'), primaryRelatedRec, 'Prior to changes primaryRec relatedChild should be');
|
230
|
+
equals(primaryRelatedRec.get('relatedParent'), primaryRec, 'Prior to changes primaryRelatedRec relatedParent should be');
|
231
|
+
equals(primaryRelatedRecs1.get('relatedParent'), primaryRec, 'Prior to changes primaryRelatedRecs1 relatedParent should be');
|
232
|
+
equals(primaryRelatedRecs2.get('relatedParent'), primaryRec, 'Prior to changes primaryRelatedRecs2 relatedParent should be');
|
233
|
+
equals(primaryRec.get('status'), SC.Record.READY_CLEAN, 'Prior to changes primaryRec status should be READY_CLEAN');
|
234
|
+
equals(primaryRelatedRec.get('status'), SC.Record.READY_CLEAN, 'Prior to changes primaryRelatedRec status should be READY_CLEAN');
|
235
|
+
equals(primaryRelatedRecs1.get('status'), SC.Record.READY_CLEAN, 'Prior to changes primaryRelatedRecs1 status should be READY_CLEAN');
|
236
|
+
equals(primaryRelatedRecs2.get('status'), SC.Record.READY_CLEAN, 'Prior to changes primaryRelatedRecs2 status should be READY_CLEAN');
|
237
|
+
|
238
|
+
nestedRec.set('relatedChild', null);
|
239
|
+
nestedRelatedRecs2.set('relatedParent', null);
|
240
|
+
nestedRec.get('relatedChildren').popObject();
|
241
|
+
|
242
|
+
// Modifying nested store record relationships should not modify primary store record relationships
|
243
|
+
equals(primaryRec.get('relatedChild'), primaryRelatedRec, 'After nested changes primaryRec relatedChild should be');
|
244
|
+
equals(primaryRelatedRec.get('relatedParent'), primaryRec, 'After nested changes primaryRelatedRec relatedParent should be');
|
245
|
+
equals(primaryRelatedRecs1.get('relatedParent'), primaryRec, 'After nested changes primaryRelatedRecs1 relatedParent should be');
|
246
|
+
equals(primaryRelatedRecs2.get('relatedParent'), primaryRec, 'After nested changes primaryRelatedRecs2 relatedParent should be');
|
247
|
+
equals(primaryRec.get('status'), SC.Record.READY_CLEAN, 'After nested changes primaryRec status should be READY_CLEAN');
|
248
|
+
equals(primaryRelatedRec.get('status'), SC.Record.READY_CLEAN, 'After nested changes primaryRelatedRec status should be READY_CLEAN');
|
249
|
+
equals(primaryRelatedRecs1.get('status'), SC.Record.READY_CLEAN, 'After nested changes primaryRelatedRecs1 status should be READY_CLEAN');
|
250
|
+
equals(primaryRelatedRecs2.get('status'), SC.Record.READY_CLEAN, 'After nested changes primaryRelatedRecs2 status should be READY_CLEAN');
|
251
|
+
equals(nestedRec.get('relatedChild'), null, 'After nested changes nestedRec relatedChild should be');
|
252
|
+
equals(nestedRelatedRec.get('relatedParent'), null, 'After nested changes nestedRelatedRec relatedParent should be');
|
253
|
+
equals(nestedRelatedRecs1.get('relatedParent'), null, 'After nested changes nestedRelatedRecs1 relatedParent should be');
|
254
|
+
equals(nestedRelatedRecs2.get('relatedParent'), null, 'After nested changes nestedRelatedRecs2 relatedParent should be');
|
255
|
+
equals(nestedRec.get('status'), SC.Record.READY_DIRTY, 'After nested changes relatedChild status should be READY_DIRTY');
|
256
|
+
equals(nestedRelatedRec.get('status'), SC.Record.READY_CLEAN, 'After nested changes nestedRelatedRec status should be READY_CLEAN');
|
257
|
+
equals(nestedRelatedRecs1.get('status'), SC.Record.READY_CLEAN, 'After nested changes nestedRelatedRecs1 status should be READY_CLEAN');
|
258
|
+
equals(nestedRelatedRecs2.get('status'), SC.Record.READY_CLEAN, 'After nested changes nestedRelatedRecs2 status should be READY_CLEAN');
|
259
|
+
|
260
|
+
// commit changes - note: still inside runloop
|
261
|
+
nestedStore.commitChanges();
|
262
|
+
equals(primaryRec.get('relatedChild'), null, 'After commit changes primaryRec relatedChild should be');
|
263
|
+
equals(primaryRelatedRec.get('relatedParent'), null, 'After commit changes primaryRelatedRec relatedParent should be');
|
264
|
+
equals(primaryRelatedRecs1.get('relatedParent'), null, 'After commit changes primaryRelatedRecs1 relatedParent should be');
|
265
|
+
equals(primaryRelatedRecs2.get('relatedParent'), null, 'After commit changes primaryRelatedRecs2 relatedParent should be');
|
266
|
+
equals(primaryRec.get('status'), SC.Record.READY_DIRTY, 'After commit changes primaryRec status should be READY_DIRTY');
|
267
|
+
equals(primaryRelatedRec.get('status'), SC.Record.READY_CLEAN, 'After commit changes primaryRelatedRec status should be READY_CLEAN');
|
268
|
+
equals(primaryRelatedRecs1.get('status'), SC.Record.READY_CLEAN, 'After commit changes primaryRelatedRecs1 status should be READY_CLEAN');
|
269
|
+
equals(primaryRelatedRecs2.get('status'), SC.Record.READY_CLEAN, 'After commit changes primaryRelatedRecs2 status should be READY_CLEAN');
|
270
|
+
|
271
|
+
SC.RunLoop.end();
|
272
|
+
|
273
|
+
delete window.MyApp;
|
173
274
|
});
|
@@ -650,6 +650,7 @@ SC.MenuPane = SC.PickerPane.extend(
|
|
650
650
|
createMenuItemViews: function() {
|
651
651
|
var views = [], items = this.get('displayItems'),
|
652
652
|
exampleView = this.get('exampleView'), item, itemView, view,
|
653
|
+
exampleViewKey, itemExampleView,
|
653
654
|
height, heightKey, separatorKey, defaultHeight, separatorHeight,
|
654
655
|
menuHeight, menuHeightPadding, keyEquivalentKey, keyEquivalent,
|
655
656
|
keyArray, idx, layerIdKey, propertiesHash,
|
@@ -39,7 +39,8 @@ SC.mixin( /** @scope SC */ {
|
|
39
39
|
// quickly.
|
40
40
|
var keys = ['maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'centerY',
|
41
41
|
'centerX', 'width', 'height', 'bottom', 'right', 'top',
|
42
|
-
'left'
|
42
|
+
'left', 'zIndex', 'opacity', 'border', 'borderLeft',
|
43
|
+
'borderRight', 'borderTop', 'borderBottom'],
|
43
44
|
keyValues = [], key,
|
44
45
|
i = keys.length;
|
45
46
|
while (--i >= 0) {
|
@@ -231,7 +232,7 @@ SC.mixin( /** @scope SC */ {
|
|
231
232
|
width: element.clientWidth + padding,
|
232
233
|
height: element.clientHeight
|
233
234
|
};
|
234
|
-
|
235
|
+
|
235
236
|
// Firefox seems to be 1 px short at times, especially with non english characters.
|
236
237
|
if (SC.browser.isMozilla) {
|
237
238
|
result.width += 1;
|
@@ -39,7 +39,7 @@ window.SproutCore = window.SproutCore || SC ;
|
|
39
39
|
// rest of the methods go into the mixin defined below.
|
40
40
|
|
41
41
|
/**
|
42
|
-
@version 1.9.
|
42
|
+
@version 1.9.1
|
43
43
|
@namespace
|
44
44
|
|
45
45
|
All SproutCore methods and functions are defined
|
@@ -59,7 +59,7 @@ window.SproutCore = window.SproutCore || SC ;
|
|
59
59
|
*/
|
60
60
|
SC = window.SC; // This is dumb but necessary for jsdoc to get it right
|
61
61
|
|
62
|
-
SC.VERSION = '1.9.
|
62
|
+
SC.VERSION = '1.9.1';
|
63
63
|
|
64
64
|
/**
|
65
65
|
@private
|
@@ -45,13 +45,17 @@ SC.String = /** @scope SC.String.prototype */ {
|
|
45
45
|
|
46
46
|
Indexed Parameters
|
47
47
|
--------------------
|
48
|
-
Indexed parameters are just arguments you pass into format.
|
49
|
-
|
50
|
-
|
48
|
+
Indexed parameters are just arguments you pass into format. For example:
|
49
|
+
|
50
|
+
"%@1 %@3 %@2".fmt(1, 2, 3)
|
51
|
+
|
52
|
+
// -> "1 3 2"
|
51
53
|
|
52
|
-
If you don't supply a number, it will use them in the order you supplied. For
|
54
|
+
If you don't supply a number, it will use them in the order you supplied. For example:
|
53
55
|
|
54
|
-
"
|
56
|
+
"%@, %@".fmt("Iskander", "Alex")
|
57
|
+
|
58
|
+
// -> "Iskander, Alex"
|
55
59
|
|
56
60
|
Named Paramters
|
57
61
|
--------------------
|
@@ -90,7 +90,6 @@ module SC::Helpers
|
|
90
90
|
|
91
91
|
if html_paths.length > 0
|
92
92
|
command = %{java -jar "#{SC.html_jar}" "#{html_paths.join '" "'}" 2>&1}
|
93
|
-
puts "Executing #{command}"
|
94
93
|
output = `#{command}`
|
95
94
|
|
96
95
|
SC.logger.info output
|
@@ -106,7 +105,6 @@ module SC::Helpers
|
|
106
105
|
if js_paths.length > 0
|
107
106
|
js_paths.each {|p|
|
108
107
|
command = %{java -Xmx512m -XX:MaxPermSize=256m -jar "#{SC.js_jar}" -o "#{p}" "#{p}" 2>&1}
|
109
|
-
puts "Executing #{command}"
|
110
108
|
output = `#{command}`
|
111
109
|
|
112
110
|
SC.logger.info output
|
@@ -72,10 +72,9 @@ module SC
|
|
72
72
|
|
73
73
|
#Missing:
|
74
74
|
#need a way to rename/move files and folders
|
75
|
-
|
76
75
|
case action
|
77
76
|
when nil #sends the contents of the file
|
78
|
-
send_file(path)
|
77
|
+
send_file(path, env)
|
79
78
|
when 'list' #returns folder structure
|
80
79
|
list_files(path)
|
81
80
|
when 'save' #doesn't do anything useful
|
@@ -139,10 +138,10 @@ module SC
|
|
139
138
|
end
|
140
139
|
end
|
141
140
|
|
142
|
-
def send_file(original_path)
|
141
|
+
def send_file(original_path, env)
|
143
142
|
with_sanitized_path(original_path) do |sanitized_path|
|
144
143
|
with_readable_path(sanitized_path) do |readable_path|
|
145
|
-
send_file_response(readable_path)
|
144
|
+
send_file_response(readable_path, env)
|
146
145
|
end
|
147
146
|
end
|
148
147
|
end
|
@@ -236,7 +235,7 @@ module SC
|
|
236
235
|
yield tempfile.path
|
237
236
|
end
|
238
237
|
|
239
|
-
def send_file_response(path)
|
238
|
+
def send_file_response(path, env)
|
240
239
|
if size = File.size?(path)
|
241
240
|
# use Rack::File so streaming works and for max compatibility with
|
242
241
|
# other handlers
|
@@ -244,6 +243,7 @@ module SC
|
|
244
243
|
# the server supports it
|
245
244
|
body = ::Rack::File::new(root_dir)
|
246
245
|
body.path = path
|
246
|
+
body.serving(env)
|
247
247
|
body
|
248
248
|
else
|
249
249
|
# file does not provide size info via stat, so we have to read it
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: sproutcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.9.
|
5
|
+
version: 1.9.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Strobe, Inc., Apple Inc. and contributors
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-12-06 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -1034,6 +1034,7 @@ files:
|
|
1034
1034
|
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js
|
1035
1035
|
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createChildViews.js
|
1036
1036
|
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js
|
1037
|
+
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroy.js
|
1037
1038
|
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js
|
1038
1039
|
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js
|
1039
1040
|
- lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/findLayerInParentLayer.js
|