vulcan 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. data/README.md +1 -80
  2. data/lib/vulcan/cli.rb +12 -33
  3. data/lib/vulcan/version.rb +1 -1
  4. data/server/bin/make +3 -1
  5. data/server/lib/spawner.js +4 -9
  6. data/server/node_modules/connect-form/node_modules/formidable/Readme.md +2 -13
  7. data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +7 -19
  8. data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +1 -12
  9. data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
  10. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +10 -0
  11. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +9 -0
  12. data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
  13. data/server/node_modules/cradle/lib/cradle.js +1 -0
  14. data/server/node_modules/cradle/node_modules/vows/LICENSE +20 -0
  15. data/server/node_modules/cradle/node_modules/vows/Makefile +7 -0
  16. data/server/node_modules/cradle/node_modules/vows/README.md +39 -0
  17. data/server/node_modules/cradle/node_modules/vows/bin/vows +515 -0
  18. data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +27 -0
  19. data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +215 -0
  20. data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +77 -0
  21. data/server/node_modules/cradle/node_modules/vows/lib/vows.js +193 -0
  22. data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +131 -0
  23. data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +55 -0
  24. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +29 -0
  25. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +2 -0
  26. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +61 -0
  27. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +54 -0
  28. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +54 -0
  29. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +38 -0
  30. data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +28 -0
  31. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +67 -0
  32. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +16 -0
  33. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +8 -0
  34. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +44 -0
  35. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +39 -0
  36. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
  37. data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +319 -0
  38. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +20 -0
  39. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +4 -0
  40. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +72 -0
  41. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +233 -0
  42. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +14 -0
  43. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +55 -0
  44. data/server/node_modules/cradle/node_modules/vows/package.json +14 -0
  45. data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +135 -0
  46. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +18 -0
  47. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +18 -0
  48. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +17 -0
  49. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +18 -0
  50. data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +140 -0
  51. data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +133 -0
  52. data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +51 -0
  53. data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +374 -0
  54. data/server/node_modules/cradle/package.json +3 -3
  55. data/server/node_modules/cradle/test/cache-test.js +7 -6
  56. data/server/node_modules/cradle/test/cradle-test.js +5 -4
  57. data/server/node_modules/cradle/test/response-test.js +6 -5
  58. data/server/node_modules/express/History.md +1 -53
  59. data/server/node_modules/express/Makefile +9 -3
  60. data/server/node_modules/express/Readme.md +1 -3
  61. data/server/node_modules/express/bin/express +66 -65
  62. data/server/node_modules/express/lib/express.js +1 -1
  63. data/server/node_modules/express/lib/request.js +9 -23
  64. data/server/node_modules/express/lib/response.js +2 -3
  65. data/server/node_modules/express/lib/utils.js +0 -13
  66. data/server/node_modules/express/lib/view.js +16 -19
  67. data/server/node_modules/express/lib/view/view.js +1 -2
  68. data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
  69. data/server/node_modules/express/node_modules/connect/lib/http.js +0 -2
  70. data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +31 -135
  71. data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +1 -5
  72. data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
  73. data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +21 -26
  74. data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +38 -91
  75. data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
  76. data/server/node_modules/express/node_modules/connect/lib/utils.js +4 -11
  77. data/server/node_modules/express/node_modules/connect/package.json +6 -7
  78. data/server/node_modules/express/node_modules/connect/test.js +31 -44
  79. data/server/node_modules/express/node_modules/mime/index.js +1 -0
  80. data/server/node_modules/express/node_modules/mime/mime.js +3 -3
  81. data/server/node_modules/express/node_modules/mime/{types/mime.types → mime.types} +0 -0
  82. data/server/node_modules/express/node_modules/mime/{types/node.types → node.types} +0 -17
  83. data/server/node_modules/express/node_modules/mime/package.json +10 -21
  84. data/server/node_modules/express/node_modules/mime/test.js +3 -2
  85. data/server/node_modules/express/node_modules/qs/History.md +0 -11
  86. data/server/node_modules/express/node_modules/qs/Makefile +3 -1
  87. data/server/node_modules/express/node_modules/qs/Readme.md +4 -2
  88. data/server/node_modules/express/node_modules/qs/lib/querystring.js +74 -100
  89. data/server/node_modules/express/node_modules/qs/package.json +2 -9
  90. data/server/node_modules/express/node_modules/qs/support/expresso/History.md +128 -0
  91. data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +53 -0
  92. data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +61 -0
  93. data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +856 -0
  94. data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +1080 -0
  95. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +377 -0
  96. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +290 -0
  97. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
  98. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
  99. data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +4 -0
  100. data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +16 -0
  101. data/server/node_modules/express/node_modules/qs/support/expresso/package.json +12 -0
  102. data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +91 -0
  103. data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +12 -0
  104. data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +13 -0
  105. data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +14 -0
  106. data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +146 -0
  107. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
  108. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
  109. data/server/node_modules/express/node_modules/qs/support/should/History.md +22 -0
  110. data/server/node_modules/express/node_modules/qs/support/should/Makefile +6 -0
  111. data/server/node_modules/express/node_modules/qs/support/should/Readme.md +248 -0
  112. data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +53 -0
  113. data/server/node_modules/express/node_modules/qs/support/should/index.js +2 -0
  114. data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +91 -0
  115. data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +548 -0
  116. data/server/node_modules/express/node_modules/qs/support/should/package.json +8 -0
  117. data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +358 -0
  118. data/server/node_modules/express/node_modules/qs/test/{parse.js → parse.test.js} +2 -1
  119. data/server/node_modules/express/node_modules/qs/test/{stringify.js → stringify.test.js} +0 -0
  120. data/server/node_modules/express/package.json +8 -9
  121. data/server/node_modules/node-uuid/README.md +67 -166
  122. data/server/node_modules/node-uuid/package.json +3 -5
  123. data/server/node_modules/node-uuid/{benchmark → test}/benchmark-native.c +0 -0
  124. data/server/node_modules/node-uuid/test/benchmark.js +27 -0
  125. data/server/node_modules/node-uuid/test/test.html +0 -3
  126. data/server/node_modules/node-uuid/test/test.js +57 -214
  127. data/server/node_modules/node-uuid/uuid.js +56 -225
  128. data/server/node_modules/restler/README.md +7 -20
  129. data/server/node_modules/restler/bin/restler +1 -1
  130. data/server/node_modules/restler/lib/multipartform.js +8 -9
  131. data/server/node_modules/restler/lib/restler.js +22 -64
  132. data/server/node_modules/restler/package.json +2 -2
  133. data/server/node_modules/restler/test/restler.js +2 -22
  134. data/server/node_modules/restler/test/test_helper.js +1 -20
  135. data/server/package.json +10 -10
  136. data/server/web.js +7 -30
  137. metadata +96 -89
  138. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +0 -1
  139. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
  140. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
  141. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +0 -14
  142. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +0 -286
  143. data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +0 -3
  144. data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +0 -70
  145. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +0 -43
  146. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +0 -48
  147. data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +0 -1
  148. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +0 -61
  149. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +0 -377
  150. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +0 -3
  151. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +0 -312
  152. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +0 -25
  153. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +0 -6
  154. data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +0 -22
  155. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +0 -19
  156. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +0 -1
  157. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +0 -1
  158. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
  159. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +0 -3
  160. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
  161. 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
  162. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
  163. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
  164. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
  165. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
  166. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
  167. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
  168. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +0 -21
  169. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
  170. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +0 -72
  171. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +0 -89
  172. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +0 -24
  173. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +0 -80
  174. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +0 -104
  175. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +0 -715
  176. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +0 -50
  177. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +0 -45
  178. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +0 -72
  179. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +0 -2
  180. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +0 -63
  181. data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +0 -47
  182. data/server/node_modules/express/node_modules/mkdirp/LICENSE +0 -21
  183. data/server/node_modules/express/node_modules/mkdirp/README.markdown +0 -21
  184. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +0 -6
  185. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +0 -6
  186. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +0 -19
  187. data/server/node_modules/express/node_modules/mkdirp/index.js +0 -20
  188. data/server/node_modules/express/node_modules/mkdirp/package.json +0 -23
  189. data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +0 -28
  190. data/server/node_modules/express/node_modules/mkdirp/test/race.js +0 -41
  191. data/server/node_modules/express/node_modules/mkdirp/test/rel.js +0 -32
  192. data/server/node_modules/express/node_modules/qs/test/mocha.opts +0 -2
  193. data/server/node_modules/express/testing/foo/app.js +0 -35
  194. data/server/node_modules/express/testing/foo/package.json +0 -9
  195. data/server/node_modules/express/testing/foo/public/stylesheets/style.css +0 -8
  196. data/server/node_modules/express/testing/foo/routes/index.js +0 -10
  197. data/server/node_modules/express/testing/foo/views/index.jade +0 -2
  198. data/server/node_modules/express/testing/foo/views/layout.jade +0 -6
  199. data/server/node_modules/express/testing/index.js +0 -43
  200. data/server/node_modules/express/testing/public/test.txt +0 -2971
  201. data/server/node_modules/express/testing/views/page.html +0 -1
  202. data/server/node_modules/express/testing/views/page.jade +0 -3
  203. data/server/node_modules/express/testing/views/test.md +0 -1
  204. data/server/node_modules/express/testing/views/user/index.jade +0 -1
  205. data/server/node_modules/express/testing/views/user/list.jade +0 -1
  206. data/server/node_modules/node-uuid/benchmark/README.md +0 -53
  207. data/server/node_modules/node-uuid/benchmark/bench.gnu +0 -174
  208. data/server/node_modules/node-uuid/benchmark/bench.sh +0 -34
  209. data/server/node_modules/node-uuid/benchmark/benchmark.js +0 -84
  210. data/server/node_modules/node-uuid/test/benchmark-native +0 -0
  211. 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,2 +0,0 @@
1
- #!/usr/bin/env node
2
- require('urun')(__dirname)
@@ -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
- }
@@ -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,6 +0,0 @@
1
- var mkdirp = require('mkdirp');
2
-
3
- mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
4
- if (err) console.error(err)
5
- else console.log('pow!')
6
- });
@@ -1,6 +0,0 @@
1
- var mkdirp = require('mkdirp');
2
-
3
- mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
4
- if (err) console.error(err)
5
- else console.log('pow!')
6
- });
@@ -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
- });