vulcan 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -80
- data/lib/vulcan/cli.rb +12 -33
- data/lib/vulcan/version.rb +1 -1
- data/server/bin/make +3 -1
- data/server/lib/spawner.js +4 -9
- data/server/node_modules/connect-form/node_modules/formidable/Readme.md +2 -13
- data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +7 -19
- data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +1 -12
- data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +10 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +9 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
- data/server/node_modules/cradle/lib/cradle.js +1 -0
- data/server/node_modules/cradle/node_modules/vows/LICENSE +20 -0
- data/server/node_modules/cradle/node_modules/vows/Makefile +7 -0
- data/server/node_modules/cradle/node_modules/vows/README.md +39 -0
- data/server/node_modules/cradle/node_modules/vows/bin/vows +515 -0
- data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +27 -0
- data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +215 -0
- data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +77 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows.js +193 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +131 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +55 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +29 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +2 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +61 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +54 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +54 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +38 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +28 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +67 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +16 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +8 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +44 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +39 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +319 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +20 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +4 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +72 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +233 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +14 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +55 -0
- data/server/node_modules/cradle/node_modules/vows/package.json +14 -0
- data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +135 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +18 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +18 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +17 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +18 -0
- data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +140 -0
- data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +133 -0
- data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +51 -0
- data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +374 -0
- data/server/node_modules/cradle/package.json +3 -3
- data/server/node_modules/cradle/test/cache-test.js +7 -6
- data/server/node_modules/cradle/test/cradle-test.js +5 -4
- data/server/node_modules/cradle/test/response-test.js +6 -5
- data/server/node_modules/express/History.md +1 -53
- data/server/node_modules/express/Makefile +9 -3
- data/server/node_modules/express/Readme.md +1 -3
- data/server/node_modules/express/bin/express +66 -65
- data/server/node_modules/express/lib/express.js +1 -1
- data/server/node_modules/express/lib/request.js +9 -23
- data/server/node_modules/express/lib/response.js +2 -3
- data/server/node_modules/express/lib/utils.js +0 -13
- data/server/node_modules/express/lib/view.js +16 -19
- data/server/node_modules/express/lib/view/view.js +1 -2
- data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/http.js +0 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +31 -135
- data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +1 -5
- data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +21 -26
- data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +38 -91
- data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/utils.js +4 -11
- data/server/node_modules/express/node_modules/connect/package.json +6 -7
- data/server/node_modules/express/node_modules/connect/test.js +31 -44
- data/server/node_modules/express/node_modules/mime/index.js +1 -0
- data/server/node_modules/express/node_modules/mime/mime.js +3 -3
- data/server/node_modules/express/node_modules/mime/{types/mime.types → mime.types} +0 -0
- data/server/node_modules/express/node_modules/mime/{types/node.types → node.types} +0 -17
- data/server/node_modules/express/node_modules/mime/package.json +10 -21
- data/server/node_modules/express/node_modules/mime/test.js +3 -2
- data/server/node_modules/express/node_modules/qs/History.md +0 -11
- data/server/node_modules/express/node_modules/qs/Makefile +3 -1
- data/server/node_modules/express/node_modules/qs/Readme.md +4 -2
- data/server/node_modules/express/node_modules/qs/lib/querystring.js +74 -100
- data/server/node_modules/express/node_modules/qs/package.json +2 -9
- data/server/node_modules/express/node_modules/qs/support/expresso/History.md +128 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +53 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +61 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +856 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +1080 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +377 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +290 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +4 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +16 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/package.json +12 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +91 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +12 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +13 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +14 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +146 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
- data/server/node_modules/express/node_modules/qs/support/should/History.md +22 -0
- data/server/node_modules/express/node_modules/qs/support/should/Makefile +6 -0
- data/server/node_modules/express/node_modules/qs/support/should/Readme.md +248 -0
- data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +53 -0
- data/server/node_modules/express/node_modules/qs/support/should/index.js +2 -0
- data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +91 -0
- data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +548 -0
- data/server/node_modules/express/node_modules/qs/support/should/package.json +8 -0
- data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +358 -0
- data/server/node_modules/express/node_modules/qs/test/{parse.js → parse.test.js} +2 -1
- data/server/node_modules/express/node_modules/qs/test/{stringify.js → stringify.test.js} +0 -0
- data/server/node_modules/express/package.json +8 -9
- data/server/node_modules/node-uuid/README.md +67 -166
- data/server/node_modules/node-uuid/package.json +3 -5
- data/server/node_modules/node-uuid/{benchmark → test}/benchmark-native.c +0 -0
- data/server/node_modules/node-uuid/test/benchmark.js +27 -0
- data/server/node_modules/node-uuid/test/test.html +0 -3
- data/server/node_modules/node-uuid/test/test.js +57 -214
- data/server/node_modules/node-uuid/uuid.js +56 -225
- data/server/node_modules/restler/README.md +7 -20
- data/server/node_modules/restler/bin/restler +1 -1
- data/server/node_modules/restler/lib/multipartform.js +8 -9
- data/server/node_modules/restler/lib/restler.js +22 -64
- data/server/node_modules/restler/package.json +2 -2
- data/server/node_modules/restler/test/restler.js +2 -22
- data/server/node_modules/restler/test/test_helper.js +1 -20
- data/server/package.json +10 -10
- data/server/web.js +7 -30
- metadata +96 -89
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +0 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +0 -14
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +0 -286
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +0 -70
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +0 -43
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +0 -48
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +0 -1
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +0 -61
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +0 -377
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +0 -312
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +0 -25
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +0 -6
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +0 -19
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +0 -1
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +0 -1
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +0 -21
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +0 -72
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +0 -89
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +0 -80
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +0 -104
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +0 -715
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +0 -50
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +0 -45
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +0 -72
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +0 -2
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +0 -63
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +0 -47
- data/server/node_modules/express/node_modules/mkdirp/LICENSE +0 -21
- data/server/node_modules/express/node_modules/mkdirp/README.markdown +0 -21
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +0 -6
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +0 -6
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +0 -19
- data/server/node_modules/express/node_modules/mkdirp/index.js +0 -20
- data/server/node_modules/express/node_modules/mkdirp/package.json +0 -23
- data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +0 -28
- data/server/node_modules/express/node_modules/mkdirp/test/race.js +0 -41
- data/server/node_modules/express/node_modules/mkdirp/test/rel.js +0 -32
- data/server/node_modules/express/node_modules/qs/test/mocha.opts +0 -2
- data/server/node_modules/express/testing/foo/app.js +0 -35
- data/server/node_modules/express/testing/foo/package.json +0 -9
- data/server/node_modules/express/testing/foo/public/stylesheets/style.css +0 -8
- data/server/node_modules/express/testing/foo/routes/index.js +0 -10
- data/server/node_modules/express/testing/foo/views/index.jade +0 -2
- data/server/node_modules/express/testing/foo/views/layout.jade +0 -6
- data/server/node_modules/express/testing/index.js +0 -43
- data/server/node_modules/express/testing/public/test.txt +0 -2971
- data/server/node_modules/express/testing/views/page.html +0 -1
- data/server/node_modules/express/testing/views/page.jade +0 -3
- data/server/node_modules/express/testing/views/test.md +0 -1
- data/server/node_modules/express/testing/views/user/index.jade +0 -1
- data/server/node_modules/express/testing/views/user/list.jade +0 -1
- data/server/node_modules/node-uuid/benchmark/README.md +0 -53
- data/server/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- data/server/node_modules/node-uuid/benchmark/bench.sh +0 -34
- data/server/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- data/server/node_modules/node-uuid/test/benchmark-native +0 -0
- data/server/node_modules/node-uuid/test/compare_v1.js +0 -63
@@ -1,50 +0,0 @@
|
|
1
|
-
var common = require('../common');
|
2
|
-
var multipartParser = require(common.lib + '/multipart_parser'),
|
3
|
-
MultipartParser = multipartParser.MultipartParser,
|
4
|
-
events = require('events'),
|
5
|
-
Buffer = require('buffer').Buffer,
|
6
|
-
parser;
|
7
|
-
|
8
|
-
function test(test) {
|
9
|
-
parser = new MultipartParser();
|
10
|
-
test();
|
11
|
-
}
|
12
|
-
|
13
|
-
test(function constructor() {
|
14
|
-
assert.equal(parser.boundary, null);
|
15
|
-
assert.equal(parser.state, 0);
|
16
|
-
assert.equal(parser.flags, 0);
|
17
|
-
assert.equal(parser.boundaryChars, null);
|
18
|
-
assert.equal(parser.index, null);
|
19
|
-
assert.equal(parser.lookbehind, null);
|
20
|
-
assert.equal(parser.constructor.name, 'MultipartParser');
|
21
|
-
});
|
22
|
-
|
23
|
-
test(function initWithBoundary() {
|
24
|
-
var boundary = 'abc';
|
25
|
-
parser.initWithBoundary(boundary);
|
26
|
-
assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]);
|
27
|
-
assert.equal(parser.state, multipartParser.START);
|
28
|
-
|
29
|
-
assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true});
|
30
|
-
});
|
31
|
-
|
32
|
-
test(function parserError() {
|
33
|
-
var boundary = 'abc',
|
34
|
-
buffer = new Buffer(5);
|
35
|
-
|
36
|
-
parser.initWithBoundary(boundary);
|
37
|
-
buffer.write('--ad', 'ascii', 0);
|
38
|
-
assert.equal(parser.write(buffer), 3);
|
39
|
-
});
|
40
|
-
|
41
|
-
test(function end() {
|
42
|
-
(function testError() {
|
43
|
-
assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain());
|
44
|
-
})();
|
45
|
-
|
46
|
-
(function testRegular() {
|
47
|
-
parser.state = multipartParser.END;
|
48
|
-
assert.strictEqual(parser.end(), undefined);
|
49
|
-
})();
|
50
|
-
});
|
@@ -1,45 +0,0 @@
|
|
1
|
-
var common = require('../common');
|
2
|
-
var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser,
|
3
|
-
Buffer = require('buffer').Buffer,
|
4
|
-
gently,
|
5
|
-
parser;
|
6
|
-
|
7
|
-
function test(test) {
|
8
|
-
gently = new Gently();
|
9
|
-
parser = new QuerystringParser();
|
10
|
-
test();
|
11
|
-
gently.verify(test.name);
|
12
|
-
}
|
13
|
-
|
14
|
-
test(function constructor() {
|
15
|
-
assert.equal(parser.buffer, '');
|
16
|
-
assert.equal(parser.constructor.name, 'QuerystringParser');
|
17
|
-
});
|
18
|
-
|
19
|
-
test(function write() {
|
20
|
-
var a = new Buffer('a=1');
|
21
|
-
assert.equal(parser.write(a), a.length);
|
22
|
-
|
23
|
-
var b = new Buffer('&b=2');
|
24
|
-
parser.write(b);
|
25
|
-
assert.equal(parser.buffer, a + b);
|
26
|
-
});
|
27
|
-
|
28
|
-
test(function end() {
|
29
|
-
var FIELDS = {a: ['b', {c: 'd'}], e: 'f'};
|
30
|
-
|
31
|
-
gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) {
|
32
|
-
assert.equal(str, parser.buffer);
|
33
|
-
return FIELDS;
|
34
|
-
});
|
35
|
-
|
36
|
-
gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) {
|
37
|
-
assert.deepEqual(FIELDS[key], val);
|
38
|
-
});
|
39
|
-
|
40
|
-
gently.expect(parser, 'onEnd');
|
41
|
-
|
42
|
-
parser.buffer = 'my buffer';
|
43
|
-
parser.end();
|
44
|
-
assert.equal(parser.buffer, '');
|
45
|
-
});
|
@@ -1,72 +0,0 @@
|
|
1
|
-
var common = require('../common');
|
2
|
-
var BOUNDARY = '---------------------------10102754414578508781458777923',
|
3
|
-
FIXTURE = TEST_FIXTURES+'/multi_video.upload',
|
4
|
-
fs = require('fs'),
|
5
|
-
util = require(common.lib + '/util'),
|
6
|
-
http = require('http'),
|
7
|
-
formidable = require(common.lib + '/index'),
|
8
|
-
server = http.createServer();
|
9
|
-
|
10
|
-
server.on('request', function(req, res) {
|
11
|
-
var form = new formidable.IncomingForm(),
|
12
|
-
uploads = {};
|
13
|
-
|
14
|
-
form.uploadDir = TEST_TMP;
|
15
|
-
form.parse(req);
|
16
|
-
|
17
|
-
form
|
18
|
-
.on('fileBegin', function(field, file) {
|
19
|
-
assert.equal(field, 'upload');
|
20
|
-
|
21
|
-
var tracker = {file: file, progress: [], ended: false};
|
22
|
-
uploads[file.filename] = tracker;
|
23
|
-
file
|
24
|
-
.on('progress', function(bytesReceived) {
|
25
|
-
tracker.progress.push(bytesReceived);
|
26
|
-
assert.equal(bytesReceived, file.length);
|
27
|
-
})
|
28
|
-
.on('end', function() {
|
29
|
-
tracker.ended = true;
|
30
|
-
});
|
31
|
-
})
|
32
|
-
.on('field', function(field, value) {
|
33
|
-
assert.equal(field, 'title');
|
34
|
-
assert.equal(value, '');
|
35
|
-
})
|
36
|
-
.on('file', function(field, file) {
|
37
|
-
assert.equal(field, 'upload');
|
38
|
-
assert.strictEqual(uploads[file.filename].file, file);
|
39
|
-
})
|
40
|
-
.on('end', function() {
|
41
|
-
assert.ok(uploads['shortest_video.flv']);
|
42
|
-
assert.ok(uploads['shortest_video.flv'].ended);
|
43
|
-
assert.ok(uploads['shortest_video.flv'].progress.length > 3);
|
44
|
-
assert.equal(uploads['shortest_video.flv'].progress.slice(-1), uploads['shortest_video.flv'].file.length);
|
45
|
-
assert.ok(uploads['shortest_video.mp4']);
|
46
|
-
assert.ok(uploads['shortest_video.mp4'].ended);
|
47
|
-
assert.ok(uploads['shortest_video.mp4'].progress.length > 3);
|
48
|
-
|
49
|
-
server.close();
|
50
|
-
res.writeHead(200);
|
51
|
-
res.end('good');
|
52
|
-
});
|
53
|
-
});
|
54
|
-
|
55
|
-
server.listen(TEST_PORT, function() {
|
56
|
-
var client = http.createClient(TEST_PORT),
|
57
|
-
stat = fs.statSync(FIXTURE),
|
58
|
-
headers = {
|
59
|
-
'content-type': 'multipart/form-data; boundary='+BOUNDARY,
|
60
|
-
'content-length': stat.size,
|
61
|
-
}
|
62
|
-
request = client.request('POST', '/', headers),
|
63
|
-
fixture = new fs.ReadStream(FIXTURE);
|
64
|
-
|
65
|
-
fixture
|
66
|
-
.on('data', function(b) {
|
67
|
-
request.write(b);
|
68
|
-
})
|
69
|
-
.on('end', function() {
|
70
|
-
request.end();
|
71
|
-
});
|
72
|
-
});
|
@@ -1,63 +0,0 @@
|
|
1
|
-
var common = require('../common');
|
2
|
-
var test = require('utest');
|
3
|
-
var assert = common.assert;
|
4
|
-
var IncomingForm = common.require('incoming_form').IncomingForm;
|
5
|
-
var path = require('path');
|
6
|
-
|
7
|
-
var from;
|
8
|
-
test('IncomingForm', {
|
9
|
-
before: function() {
|
10
|
-
form = new IncomingForm();
|
11
|
-
},
|
12
|
-
|
13
|
-
'#_fileName with regular characters': function() {
|
14
|
-
var filename = 'foo.txt';
|
15
|
-
assert.equal(form._fileName(makeHeader(filename)), 'foo.txt');
|
16
|
-
},
|
17
|
-
|
18
|
-
'#_fileName with unescaped quote': function() {
|
19
|
-
var filename = 'my".txt';
|
20
|
-
assert.equal(form._fileName(makeHeader(filename)), 'my".txt');
|
21
|
-
},
|
22
|
-
|
23
|
-
'#_fileName with escaped quote': function() {
|
24
|
-
var filename = 'my%22.txt';
|
25
|
-
assert.equal(form._fileName(makeHeader(filename)), 'my".txt');
|
26
|
-
},
|
27
|
-
|
28
|
-
'#_fileName with bad quote and additional sub-header': function() {
|
29
|
-
var filename = 'my".txt';
|
30
|
-
var header = makeHeader(filename) + '; foo="bar"';
|
31
|
-
assert.equal(form._fileName(header), filename);
|
32
|
-
},
|
33
|
-
|
34
|
-
'#_fileName with semicolon': function() {
|
35
|
-
var filename = 'my;.txt';
|
36
|
-
assert.equal(form._fileName(makeHeader(filename)), 'my;.txt');
|
37
|
-
},
|
38
|
-
|
39
|
-
'#_fileName with utf8 character': function() {
|
40
|
-
var filename = 'my☃.txt';
|
41
|
-
assert.equal(form._fileName(makeHeader(filename)), 'my☃.txt');
|
42
|
-
},
|
43
|
-
|
44
|
-
'#_uploadPath strips harmful characters from extension when keepExtensions': function() {
|
45
|
-
form.keepExtensions = true;
|
46
|
-
|
47
|
-
var ext = path.extname(form._uploadPath('fine.jpg?foo=bar'));
|
48
|
-
assert.equal(ext, '.jpg');
|
49
|
-
|
50
|
-
var ext = path.extname(form._uploadPath('fine?foo=bar'));
|
51
|
-
assert.equal(ext, '');
|
52
|
-
|
53
|
-
var ext = path.extname(form._uploadPath('super.cr2+dsad'));
|
54
|
-
assert.equal(ext, '.cr2');
|
55
|
-
|
56
|
-
var ext = path.extname(form._uploadPath('super.bar'));
|
57
|
-
assert.equal(ext, '.bar');
|
58
|
-
},
|
59
|
-
});
|
60
|
-
|
61
|
-
function makeHeader(filename) {
|
62
|
-
return 'Content-Disposition: form-data; name="upload"; filename="' + filename + '"';
|
63
|
-
}
|
data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
var http = require('http');
|
2
|
-
var fs = require('fs');
|
3
|
-
var connections = 0;
|
4
|
-
|
5
|
-
var server = http.createServer(function(req, res) {
|
6
|
-
var socket = req.socket;
|
7
|
-
console.log('Request: %s %s -> %s', req.method, req.url, socket.filename);
|
8
|
-
|
9
|
-
req.on('end', function() {
|
10
|
-
if (req.url !== '/') {
|
11
|
-
res.end(JSON.stringify({
|
12
|
-
method: req.method,
|
13
|
-
url: req.url,
|
14
|
-
filename: socket.filename,
|
15
|
-
}));
|
16
|
-
return;
|
17
|
-
}
|
18
|
-
|
19
|
-
res.writeHead(200, {'content-type': 'text/html'});
|
20
|
-
res.end(
|
21
|
-
'<form action="/upload" enctype="multipart/form-data" method="post">'+
|
22
|
-
'<input type="text" name="title"><br>'+
|
23
|
-
'<input type="file" name="upload" multiple="multiple"><br>'+
|
24
|
-
'<input type="submit" value="Upload">'+
|
25
|
-
'</form>'
|
26
|
-
);
|
27
|
-
});
|
28
|
-
});
|
29
|
-
|
30
|
-
server.on('connection', function(socket) {
|
31
|
-
connections++;
|
32
|
-
|
33
|
-
socket.id = connections;
|
34
|
-
socket.filename = 'connection-' + socket.id + '.http';
|
35
|
-
socket.file = fs.createWriteStream(socket.filename);
|
36
|
-
socket.pipe(socket.file);
|
37
|
-
|
38
|
-
console.log('--> %s', socket.filename);
|
39
|
-
socket.on('close', function() {
|
40
|
-
console.log('<-- %s', socket.filename);
|
41
|
-
});
|
42
|
-
});
|
43
|
-
|
44
|
-
var port = process.env.PORT || 8080;
|
45
|
-
server.listen(port, function() {
|
46
|
-
console.log('Recording connections on port %s', port);
|
47
|
-
});
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Copyright 2010 James Halliday (mail@substack.net)
|
2
|
-
|
3
|
-
This project is free software released under the MIT/X11 license:
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,21 +0,0 @@
|
|
1
|
-
mkdirp
|
2
|
-
======
|
3
|
-
|
4
|
-
Like `mkdir -p`, but in node.js!
|
5
|
-
|
6
|
-
Example
|
7
|
-
=======
|
8
|
-
|
9
|
-
pow.js
|
10
|
-
------
|
11
|
-
var mkdirp = require('mkdirp');
|
12
|
-
|
13
|
-
mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
|
14
|
-
if (err) console.error(err)
|
15
|
-
else console.log('pow!')
|
16
|
-
});
|
17
|
-
|
18
|
-
Output
|
19
|
-
pow!
|
20
|
-
|
21
|
-
And now /tmp/foo/bar/baz exists, huzzah!
|
@@ -1,19 +0,0 @@
|
|
1
|
-
--- examples/pow.js
|
2
|
-
+++ examples/pow.js
|
3
|
-
@@ -1,6 +1,15 @@
|
4
|
-
-var mkdirp = require('mkdirp').mkdirp;
|
5
|
-
+var mkdirp = require('../').mkdirp,
|
6
|
-
+ mkdirpSync = require('../').mkdirpSync;
|
7
|
-
|
8
|
-
mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
|
9
|
-
if (err) console.error(err)
|
10
|
-
else console.log('pow!')
|
11
|
-
});
|
12
|
-
+
|
13
|
-
+try {
|
14
|
-
+ mkdirpSync('/tmp/bar/foo/baz', 0755);
|
15
|
-
+ console.log('double pow!');
|
16
|
-
+}
|
17
|
-
+catch (ex) {
|
18
|
-
+ console.log(ex);
|
19
|
-
+}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
var path = require('path');
|
2
|
-
var fs = require('fs');
|
3
|
-
|
4
|
-
var exports = module.exports = function mkdirP (p, mode, f) {
|
5
|
-
var cb = f || function () {};
|
6
|
-
p = path.resolve(p);
|
7
|
-
|
8
|
-
var ps = path.normalize(p).split('/');
|
9
|
-
path.exists(p, function (exists) {
|
10
|
-
if (exists) cb(null);
|
11
|
-
else mkdirP(ps.slice(0,-1).join('/'), mode, function (err) {
|
12
|
-
if (err && err.code !== 'EEXIST') cb(err)
|
13
|
-
else fs.mkdir(p, mode, function (err) {
|
14
|
-
if (err && err.code !== 'EEXIST') cb(err)
|
15
|
-
else cb()
|
16
|
-
});
|
17
|
-
});
|
18
|
-
});
|
19
|
-
};
|
20
|
-
exports.mkdirp = exports.mkdirP = module.exports;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name" : "mkdirp",
|
3
|
-
"description" : "Recursively mkdir, like `mkdir -p`",
|
4
|
-
"version" : "0.0.7",
|
5
|
-
"author" : "James Halliday <mail@substack.net> (http://substack.net)",
|
6
|
-
"main" : "./index",
|
7
|
-
"keywords" : [
|
8
|
-
"mkdir",
|
9
|
-
"directory"
|
10
|
-
],
|
11
|
-
"repository" : {
|
12
|
-
"type" : "git",
|
13
|
-
"url" : "http://github.com/substack/node-mkdirp.git"
|
14
|
-
},
|
15
|
-
"scripts" : {
|
16
|
-
"test" : "node node_modules/tap/bin/tap.js test/*.js"
|
17
|
-
},
|
18
|
-
"devDependencies" : {
|
19
|
-
"tap" : "0.0.x"
|
20
|
-
},
|
21
|
-
"license" : "MIT/X11",
|
22
|
-
"engines": { "node": "*" }
|
23
|
-
}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
var mkdirp = require('../');
|
2
|
-
var path = require('path');
|
3
|
-
var fs = require('fs');
|
4
|
-
var test = require('tap').test;
|
5
|
-
|
6
|
-
test('woo', function (t) {
|
7
|
-
t.plan(2);
|
8
|
-
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
9
|
-
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
10
|
-
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
11
|
-
|
12
|
-
var file = '/tmp/' + [x,y,z].join('/');
|
13
|
-
|
14
|
-
mkdirp(file, 0755, function (err) {
|
15
|
-
if (err) t.fail(err);
|
16
|
-
else path.exists(file, function (ex) {
|
17
|
-
if (!ex) t.fail('file not created')
|
18
|
-
else fs.stat(file, function (err, stat) {
|
19
|
-
if (err) t.fail(err)
|
20
|
-
else {
|
21
|
-
t.equal(stat.mode & 0777, 0755);
|
22
|
-
t.ok(stat.isDirectory(), 'target not a directory');
|
23
|
-
t.end();
|
24
|
-
}
|
25
|
-
})
|
26
|
-
})
|
27
|
-
});
|
28
|
-
});
|