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,3 +0,0 @@
1
- var IncomingForm = require('./incoming_form').IncomingForm;
2
- IncomingForm.IncomingForm = IncomingForm;
3
- module.exports = IncomingForm;
@@ -1,312 +0,0 @@
1
- var Buffer = require('buffer').Buffer,
2
- s = 0,
3
- S =
4
- { PARSER_UNINITIALIZED: s++,
5
- START: s++,
6
- START_BOUNDARY: s++,
7
- HEADER_FIELD_START: s++,
8
- HEADER_FIELD: s++,
9
- HEADER_VALUE_START: s++,
10
- HEADER_VALUE: s++,
11
- HEADER_VALUE_ALMOST_DONE: s++,
12
- HEADERS_ALMOST_DONE: s++,
13
- PART_DATA_START: s++,
14
- PART_DATA: s++,
15
- PART_END: s++,
16
- END: s++,
17
- },
18
-
19
- f = 1,
20
- F =
21
- { PART_BOUNDARY: f,
22
- LAST_BOUNDARY: f *= 2,
23
- },
24
-
25
- LF = 10,
26
- CR = 13,
27
- SPACE = 32,
28
- HYPHEN = 45,
29
- COLON = 58,
30
- A = 97,
31
- Z = 122,
32
-
33
- lower = function(c) {
34
- return c | 0x20;
35
- };
36
-
37
- for (var s in S) {
38
- exports[s] = S[s];
39
- }
40
-
41
- function MultipartParser() {
42
- this.boundary = null;
43
- this.boundaryChars = null;
44
- this.lookbehind = null;
45
- this.state = S.PARSER_UNINITIALIZED;
46
-
47
- this.index = null;
48
- this.flags = 0;
49
- };
50
- exports.MultipartParser = MultipartParser;
51
-
52
- MultipartParser.stateToString = function(stateNumber) {
53
- for (var state in S) {
54
- var number = S[state];
55
- if (number === stateNumber) return state;
56
- }
57
- };
58
-
59
- MultipartParser.prototype.initWithBoundary = function(str) {
60
- this.boundary = new Buffer(str.length+4);
61
- this.boundary.write('\r\n--', 'ascii', 0);
62
- this.boundary.write(str, 'ascii', 4);
63
- this.lookbehind = new Buffer(this.boundary.length+8);
64
- this.state = S.START;
65
-
66
- this.boundaryChars = {};
67
- for (var i = 0; i < this.boundary.length; i++) {
68
- this.boundaryChars[this.boundary[i]] = true;
69
- }
70
- };
71
-
72
- MultipartParser.prototype.write = function(buffer) {
73
- var self = this,
74
- i = 0,
75
- len = buffer.length,
76
- prevIndex = this.index,
77
- index = this.index,
78
- state = this.state,
79
- flags = this.flags,
80
- lookbehind = this.lookbehind,
81
- boundary = this.boundary,
82
- boundaryChars = this.boundaryChars,
83
- boundaryLength = this.boundary.length,
84
- boundaryEnd = boundaryLength - 1,
85
- bufferLength = buffer.length,
86
- c,
87
- cl,
88
-
89
- mark = function(name) {
90
- self[name+'Mark'] = i;
91
- },
92
- clear = function(name) {
93
- delete self[name+'Mark'];
94
- },
95
- callback = function(name, buffer, start, end) {
96
- if (start !== undefined && start === end) {
97
- return;
98
- }
99
-
100
- var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1);
101
- if (callbackSymbol in self) {
102
- self[callbackSymbol](buffer, start, end);
103
- }
104
- },
105
- dataCallback = function(name, clear) {
106
- var markSymbol = name+'Mark';
107
- if (!(markSymbol in self)) {
108
- return;
109
- }
110
-
111
- if (!clear) {
112
- callback(name, buffer, self[markSymbol], buffer.length);
113
- self[markSymbol] = 0;
114
- } else {
115
- callback(name, buffer, self[markSymbol], i);
116
- delete self[markSymbol];
117
- }
118
- };
119
-
120
- for (i = 0; i < len; i++) {
121
- c = buffer[i];
122
- switch (state) {
123
- case S.PARSER_UNINITIALIZED:
124
- return i;
125
- case S.START:
126
- index = 0;
127
- state = S.START_BOUNDARY;
128
- case S.START_BOUNDARY:
129
- if (index == boundary.length - 2) {
130
- if (c != CR) {
131
- return i;
132
- }
133
- index++;
134
- break;
135
- } else if (index - 1 == boundary.length - 2) {
136
- if (c != LF) {
137
- return i;
138
- }
139
- index = 0;
140
- callback('partBegin');
141
- state = S.HEADER_FIELD_START;
142
- break;
143
- }
144
-
145
- if (c != boundary[index+2]) {
146
- return i;
147
- }
148
- index++;
149
- break;
150
- case S.HEADER_FIELD_START:
151
- state = S.HEADER_FIELD;
152
- mark('headerField');
153
- index = 0;
154
- case S.HEADER_FIELD:
155
- if (c == CR) {
156
- clear('headerField');
157
- state = S.HEADERS_ALMOST_DONE;
158
- break;
159
- }
160
-
161
- index++;
162
- if (c == HYPHEN) {
163
- break;
164
- }
165
-
166
- if (c == COLON) {
167
- if (index == 1) {
168
- // empty header field
169
- return i;
170
- }
171
- dataCallback('headerField', true);
172
- state = S.HEADER_VALUE_START;
173
- break;
174
- }
175
-
176
- cl = lower(c);
177
- if (cl < A || cl > Z) {
178
- return i;
179
- }
180
- break;
181
- case S.HEADER_VALUE_START:
182
- if (c == SPACE) {
183
- break;
184
- }
185
-
186
- mark('headerValue');
187
- state = S.HEADER_VALUE;
188
- case S.HEADER_VALUE:
189
- if (c == CR) {
190
- dataCallback('headerValue', true);
191
- callback('headerEnd');
192
- state = S.HEADER_VALUE_ALMOST_DONE;
193
- }
194
- break;
195
- case S.HEADER_VALUE_ALMOST_DONE:
196
- if (c != LF) {
197
- return i;
198
- }
199
- state = S.HEADER_FIELD_START;
200
- break;
201
- case S.HEADERS_ALMOST_DONE:
202
- if (c != LF) {
203
- return i;
204
- }
205
-
206
- callback('headersEnd');
207
- state = S.PART_DATA_START;
208
- break;
209
- case S.PART_DATA_START:
210
- state = S.PART_DATA
211
- mark('partData');
212
- case S.PART_DATA:
213
- prevIndex = index;
214
-
215
- if (index == 0) {
216
- // boyer-moore derrived algorithm to safely skip non-boundary data
217
- i += boundaryEnd;
218
- while (i < bufferLength && !(buffer[i] in boundaryChars)) {
219
- i += boundaryLength;
220
- }
221
- i -= boundaryEnd;
222
- c = buffer[i];
223
- }
224
-
225
- if (index < boundary.length) {
226
- if (boundary[index] == c) {
227
- if (index == 0) {
228
- dataCallback('partData', true);
229
- }
230
- index++;
231
- } else {
232
- index = 0;
233
- }
234
- } else if (index == boundary.length) {
235
- index++;
236
- if (c == CR) {
237
- // CR = part boundary
238
- flags |= F.PART_BOUNDARY;
239
- } else if (c == HYPHEN) {
240
- // HYPHEN = end boundary
241
- flags |= F.LAST_BOUNDARY;
242
- } else {
243
- index = 0;
244
- }
245
- } else if (index - 1 == boundary.length) {
246
- if (flags & F.PART_BOUNDARY) {
247
- index = 0;
248
- if (c == LF) {
249
- // unset the PART_BOUNDARY flag
250
- flags &= ~F.PART_BOUNDARY;
251
- callback('partEnd');
252
- callback('partBegin');
253
- state = S.HEADER_FIELD_START;
254
- break;
255
- }
256
- } else if (flags & F.LAST_BOUNDARY) {
257
- if (c == HYPHEN) {
258
- callback('partEnd');
259
- callback('end');
260
- state = S.END;
261
- } else {
262
- index = 0;
263
- }
264
- } else {
265
- index = 0;
266
- }
267
- }
268
-
269
- if (index > 0) {
270
- // when matching a possible boundary, keep a lookbehind reference
271
- // in case it turns out to be a false lead
272
- lookbehind[index-1] = c;
273
- } else if (prevIndex > 0) {
274
- // if our boundary turned out to be rubbish, the captured lookbehind
275
- // belongs to partData
276
- callback('partData', lookbehind, 0, prevIndex);
277
- prevIndex = 0;
278
- mark('partData');
279
-
280
- // reconsider the current character even so it interrupted the sequence
281
- // it could be the beginning of a new sequence
282
- i--;
283
- }
284
-
285
- break;
286
- case S.END:
287
- break;
288
- default:
289
- return i;
290
- }
291
- }
292
-
293
- dataCallback('headerField');
294
- dataCallback('headerValue');
295
- dataCallback('partData');
296
-
297
- this.index = index;
298
- this.state = state;
299
- this.flags = flags;
300
-
301
- return len;
302
- };
303
-
304
- MultipartParser.prototype.end = function() {
305
- if (this.state != S.END) {
306
- return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain());
307
- }
308
- };
309
-
310
- MultipartParser.prototype.explain = function() {
311
- return 'state = ' + MultipartParser.stateToString(this.state);
312
- };
@@ -1,25 +0,0 @@
1
- if (global.GENTLY) require = GENTLY.hijack(require);
2
-
3
- // This is a buffering parser, not quite as nice as the multipart one.
4
- // If I find time I'll rewrite this to be fully streaming as well
5
- var querystring = require('querystring');
6
-
7
- function QuerystringParser() {
8
- this.buffer = '';
9
- };
10
- exports.QuerystringParser = QuerystringParser;
11
-
12
- QuerystringParser.prototype.write = function(buffer) {
13
- this.buffer += buffer.toString('ascii');
14
- return buffer.length;
15
- };
16
-
17
- QuerystringParser.prototype.end = function() {
18
- var fields = querystring.parse(this.buffer);
19
- for (var field in fields) {
20
- this.onField(field, fields[field]);
21
- }
22
- this.buffer = '';
23
-
24
- this.onEnd();
25
- };
@@ -1,6 +0,0 @@
1
- // Backwards compatibility ...
2
- try {
3
- module.exports = require('util');
4
- } catch (e) {
5
- module.exports = require('sys');
6
- }
@@ -1,22 +0,0 @@
1
- {
2
- "name": "formidable",
3
- "version": "1.0.8",
4
- "dependencies": {},
5
- "devDependencies": {
6
- "gently": "0.8.0",
7
- "findit": "0.1.1",
8
- "hashish": "0.0.4",
9
- "urun": "0.0.4",
10
- "utest": "0.0.3"
11
- },
12
- "directories": {
13
- "lib": "./lib"
14
- },
15
- "main": "./lib/index",
16
- "scripts": {
17
- "test": "make test"
18
- },
19
- "engines": {
20
- "node": "*"
21
- }
22
- }
@@ -1,19 +0,0 @@
1
- var mysql = require('..');
2
- var path = require('path');
3
-
4
- var root = path.join(__dirname, '../');
5
- exports.dir = {
6
- root : root,
7
- lib : root + '/lib',
8
- fixture : root + '/test/fixture',
9
- tmp : root + '/test/tmp',
10
- };
11
-
12
- exports.port = 13532;
13
-
14
- exports.formidable = require('..');
15
- exports.assert = require('assert');
16
-
17
- exports.require = function(lib) {
18
- return require(exports.dir.lib + '/' + lib);
19
- };
@@ -1,13 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Host: localhost:8080
3
- Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
4
- Content-Length: 1000
5
-
6
- ------WebKitFormBoundarytyE4wkKlZ5CQJVTG
7
- Content-Disposition: form-data; name="upload"; filename=""
8
- Content-Type: text/plain
9
-
10
- I am a plain text file
11
-
12
- ------WebKitFormBoundarytyE4wkKlZ5CQJVTG--
13
-
@@ -1,3 +0,0 @@
1
- * Opera does not allow submitting this file, it shows a warning to the
2
- user that the file could not be found instead. Tested in 9.8, 11.51 on OSX.
3
- Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com).
@@ -1,26 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Host: localhost:8080
3
- Connection: keep-alive
4
- Referer: http://localhost:8080/
5
- Content-Length: 383
6
- Cache-Control: max-age=0
7
- Origin: http://localhost:8080
8
- User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
9
- Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
10
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
11
- Accept-Encoding: gzip,deflate,sdch
12
- Accept-Language: en-US,en;q=0.8
13
- Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
14
- Cookie: jqCookieJar_tablesorter=%7B%22showListTable%22%3A%5B%5B5%2C1%5D%2C%5B1%2C0%5D%5D%7D
15
-
16
- ------WebKitFormBoundarytyE4wkKlZ5CQJVTG
17
- Content-Disposition: form-data; name="title"
18
-
19
- Weird filename
20
- ------WebKitFormBoundarytyE4wkKlZ5CQJVTG
21
- Content-Disposition: form-data; name="upload"; filename=": \ ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
22
- Content-Type: text/plain
23
-
24
- I am a text file with a funky name!
25
-
26
- ------WebKitFormBoundarytyE4wkKlZ5CQJVTG--