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
@@ -0,0 +1 @@
1
+ module.exports = require('./mime');
@@ -83,10 +83,10 @@ var mime = module.exports = {
83
83
 
84
84
  // Load our local copy of
85
85
  // http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
86
- mime.load(path.join(__dirname, 'types/mime.types'));
86
+ mime.load(path.join(__dirname, 'mime.types'));
87
87
 
88
- // Overlay enhancements submitted by the node.js community
89
- mime.load(path.join(__dirname, 'types/node.types'));
88
+ // Overlay enhancements we've had requests for (and that seem to make sense)
89
+ mime.load(path.join(__dirname, 'node.types'));
90
90
 
91
91
  // Set the default type
92
92
  mime.default_type = mime.types.bin;
@@ -1,20 +1,3 @@
1
- # What: Google Chrome Extension
2
- # Why: To allow apps to (work) be served with the right content type header.
3
- # http://codereview.chromium.org/2830017
4
- # Added by: niftylettuce
5
- application/x-chrome-extension crx
6
-
7
- # What: OTF Message Silencer
8
- # Why: To silence the "Resource interpreted as font but transferred with MIME
9
- # type font/otf" message that occurs in Google Chrome
10
- # Added by: niftylettuce
11
- font/opentype otf
12
-
13
- # What: HTC support
14
- # Why: To properly render .htc files such as CSS3PIE
15
- # Added by: niftylettuce
16
- text/x-component htc
17
-
18
1
  # What: HTML5 application cache manifest
19
2
  # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps
20
3
  # per https://developer.mozilla.org/en/offline_resources_in_firefox
@@ -1,22 +1,11 @@
1
- {
2
- "author": {
3
- "name": "Robert Kieffer",
4
- "url": "http://github.com/broofa",
5
- "email": "robert@broofa.com"
6
- },
7
- "contributors": [
8
- {
9
- "name": "Benjamin Thomas",
10
- "url": "http://github.com/bentomas",
11
- "email": "benjamin@benjaminthomas.org"
12
- }
13
- ],
14
- "dependencies": {},
15
- "description": "A comprehensive library for mime-type mapping",
16
- "devDependencies": {"async_testing": ""},
17
- "keywords": ["util", "mime"],
18
- "main": "mime.js",
19
- "name": "mime",
20
- "repository": {"url": "http://github.com/bentomas/node-mime", "type": "git"},
21
- "version": "1.2.4"
1
+ { "name" : "mime"
2
+ , "description" : "A comprehensive library for mime-type mapping"
3
+ , "url" : "http://github.com/bentomas/node-mime"
4
+ , "keywords" : ["util", "mime"]
5
+ , "author" : "Benjamin Thomas <benjamin@benjaminthomas.org>"
6
+ , "contributors" : []
7
+ , "dependencies" : []
8
+ , "lib" : "."
9
+ , "main" : "mime.js"
10
+ , "version" : "1.2.3"
22
11
  }
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Requires the async_testing module
2
+ * Requires the async_testing module, which we're not bothering to ship as part
3
+ * of this module.
3
4
  *
4
- * Usage: node test.js
5
+ * "npm install async_testing"
5
6
  */
6
7
  var mime = require('./mime');
7
8
  exports["test mime lookup"] = function(test) {
@@ -1,15 +1,4 @@
1
1
 
2
- 0.4.0 / 2011-11-21
3
- ==================
4
-
5
- * Allow parsing of an existing object (for `bodyParser()`) [jackyz]
6
- * Replaced expresso with mocha
7
-
8
- 0.3.2 / 2011-11-08
9
- ==================
10
-
11
- * Fixed global variable leak
12
-
13
2
  0.3.1 / 2011-08-17
14
3
  ==================
15
4
 
@@ -1,5 +1,7 @@
1
1
 
2
2
  test:
3
- @./node_modules/.bin/mocha
3
+ @./support/expresso/bin/expresso \
4
+ -I support \
5
+ -I lib
4
6
 
5
7
  .PHONY: test
@@ -6,6 +6,7 @@
6
6
 
7
7
  $ npm install qs
8
8
 
9
+
9
10
  ## Examples
10
11
 
11
12
  require('qs').parse('user[name][first]=tj&user[email]=tj');
@@ -13,9 +14,10 @@
13
14
 
14
15
  ## Testing
15
16
 
16
- Install dev dependencies:
17
+ Update git submodules:
17
18
 
18
- $ npm install -d
19
+ $ git submodule init
20
+ $ git submodule update
19
21
 
20
22
  and execute:
21
23
 
@@ -1,4 +1,3 @@
1
-
2
1
  /*!
3
2
  * querystring
4
3
  * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
@@ -9,7 +8,7 @@
9
8
  * Library version.
10
9
  */
11
10
 
12
- exports.version = '0.4.0';
11
+ exports.version = '0.3.1';
13
12
 
14
13
  /**
15
14
  * Object#toString() ref for stringify().
@@ -23,95 +22,29 @@ var toString = Object.prototype.toString;
23
22
 
24
23
  var notint = /[^0-9]/;
25
24
 
26
- function promote(parent, key) {
27
- if (parent[key].length == 0) return parent[key] = {};
28
- var t = {};
29
- for (var i in parent[key]) t[i] = parent[key][i];
30
- parent[key] = t;
31
- return t;
32
- }
33
-
34
- function parse(parts, parent, key, val) {
35
- var part = parts.shift();
36
- // end
37
- if (!part) {
38
- if (Array.isArray(parent[key])) {
39
- parent[key].push(val);
40
- } else if ('object' == typeof parent[key]) {
41
- parent[key] = val;
42
- } else if ('undefined' == typeof parent[key]) {
43
- parent[key] = val;
44
- } else {
45
- parent[key] = [parent[key], val];
46
- }
47
- // array
48
- } else {
49
- var obj = parent[key] = parent[key] || [];
50
- if (']' == part) {
51
- if (Array.isArray(obj)) {
52
- if ('' != val) obj.push(val);
53
- } else if ('object' == typeof obj) {
54
- obj[Object.keys(obj).length] = val;
55
- } else {
56
- obj = parent[key] = [parent[key], val];
57
- }
58
- // prop
59
- } else if (~part.indexOf(']')) {
60
- part = part.substr(0, part.length - 1);
61
- if(notint.test(part) && Array.isArray(obj)) obj = promote(parent, key);
62
- parse(parts, obj, part, val);
63
- // key
64
- } else {
65
- if(notint.test(part) && Array.isArray(obj)) obj = promote(parent, key);
66
- parse(parts, obj, part, val);
67
- }
68
- }
69
- }
70
-
71
25
  /**
72
- * Merge parent key/val pair.
73
- */
74
-
75
- function merge(parent, key, val){
76
- if (~key.indexOf(']')) {
77
- var parts = key.split('[')
78
- , len = parts.length
79
- , last = len - 1;
80
- parse(parts, parent, 'base', val);
81
- // optimize
82
- } else {
83
- if (notint.test(key) && Array.isArray(parent.base)) {
84
- var t = {};
85
- for (var k in parent.base) t[k] = parent.base[k];
86
- parent.base = t;
87
- }
88
- set(parent.base, key, val);
89
- }
90
-
91
- return parent;
92
- }
93
-
94
- /**
95
- * Parse the given obj.
26
+ * Parse the given query `str`, returning an object.
27
+ *
28
+ * @param {String} str
29
+ * @return {Object}
30
+ * @api public
96
31
  */
97
32
 
98
- function parseObject(obj){
99
- var ret = { base: {} };
100
- Object.keys(obj).forEach(function(name){
101
- merge(ret, name, obj[name]);
102
- });
103
- return ret.base;
104
- }
33
+ exports.parse = function(str){
34
+ if (null == str || '' == str) return {};
105
35
 
106
- /**
107
- * Parse the given str.
108
- */
36
+ function promote(parent, key) {
37
+ if (parent[key].length == 0) return parent[key] = {};
38
+ var t = {};
39
+ for (var i in parent[key]) t[i] = parent[key][i];
40
+ parent[key] = t;
41
+ return t;
42
+ }
109
43
 
110
- function parseString(str){
111
44
  return String(str)
112
45
  .split('&')
113
46
  .reduce(function(ret, pair){
114
- try{
47
+ try{
115
48
  pair = decodeURIComponent(pair.replace(/\+/g, ' '));
116
49
  } catch(e) {
117
50
  // ignore
@@ -121,28 +54,69 @@ function parseString(str){
121
54
  , brace = lastBraceInKey(pair)
122
55
  , key = pair.substr(0, brace || eql)
123
56
  , val = pair.substr(brace || eql, pair.length)
124
- , val = val.substr(val.indexOf('=') + 1, val.length);
57
+ , val = val.substr(val.indexOf('=') + 1, val.length)
58
+ , parent = ret;
125
59
 
126
60
  // ?foo
127
61
  if ('' == key) key = pair, val = '';
128
62
 
129
- return merge(ret, key, val);
130
- }, { base: {} }).base;
131
- }
132
-
133
- /**
134
- * Parse the given query `str` or `obj`, returning an object.
135
- *
136
- * @param {String} str | {Object} obj
137
- * @return {Object}
138
- * @api public
139
- */
63
+ // nested
64
+ if (~key.indexOf(']')) {
65
+ var parts = key.split('[')
66
+ , len = parts.length
67
+ , last = len - 1;
68
+
69
+ function parse(parts, parent, key) {
70
+ var part = parts.shift();
71
+
72
+ // end
73
+ if (!part) {
74
+ if (Array.isArray(parent[key])) {
75
+ parent[key].push(val);
76
+ } else if ('object' == typeof parent[key]) {
77
+ parent[key] = val;
78
+ } else if ('undefined' == typeof parent[key]) {
79
+ parent[key] = val;
80
+ } else {
81
+ parent[key] = [parent[key], val];
82
+ }
83
+ // array
84
+ } else {
85
+ obj = parent[key] = parent[key] || [];
86
+ if (']' == part) {
87
+ if (Array.isArray(obj)) {
88
+ if ('' != val) obj.push(val);
89
+ } else if ('object' == typeof obj) {
90
+ obj[Object.keys(obj).length] = val;
91
+ } else {
92
+ obj = parent[key] = [parent[key], val];
93
+ }
94
+ // prop
95
+ } else if (~part.indexOf(']')) {
96
+ part = part.substr(0, part.length - 1);
97
+ if(notint.test(part) && Array.isArray(obj)) obj = promote(parent, key);
98
+ parse(parts, obj, part);
99
+ // key
100
+ } else {
101
+ if(notint.test(part) && Array.isArray(obj)) obj = promote(parent, key);
102
+ parse(parts, obj, part);
103
+ }
104
+ }
105
+ }
106
+
107
+ parse(parts, parent, 'base');
108
+ // optimize
109
+ } else {
110
+ if (notint.test(key) && Array.isArray(parent.base)) {
111
+ var t = {};
112
+ for(var k in parent.base) t[k] = parent.base[k];
113
+ parent.base = t;
114
+ }
115
+ set(parent.base, key, val);
116
+ }
140
117
 
141
- exports.parse = function(str){
142
- if (null == str || '' == str) return {};
143
- return 'object' == typeof str
144
- ? parseObject(str)
145
- : parseString(str);
118
+ return ret;
119
+ }, {base: {}}).base;
146
120
  };
147
121
 
148
122
  /**
@@ -1,15 +1,8 @@
1
1
  {
2
2
  "name": "qs",
3
3
  "description": "querystring parser",
4
- "version": "0.4.0",
5
- "repository": {
6
- "type" : "git",
7
- "url" : "git://github.com/visionmedia/node-querystring.git"
8
- },
9
- "devDependencies": {
10
- "mocha": "*"
11
- , "should": "*"
12
- },
4
+ "version": "0.3.1",
5
+ "repository": {},
13
6
  "author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
14
7
  "main": "index",
15
8
  "engines": { "node": "*" }
@@ -0,0 +1,128 @@
1
+
2
+ 0.7.2 / 2010-12-29
3
+ ==================
4
+
5
+ * Fixed problem with `listen()` sometimes firing on the same tick [guillermo]
6
+
7
+ 0.7.1 / 2010-12-28
8
+ ==================
9
+
10
+ * Fixed `assert.request()` client logic into an issue() function, fired upon the `listen()` callback if the server doesn't have an assigned fd. [guillermo]
11
+ * Removed `--watch`
12
+
13
+ 0.7.0 / 2010-11-19
14
+ ==================
15
+
16
+ * Removed `assert` from test function signature
17
+ Just use `require('assert')` :) this will make integration
18
+ with libraries like [should](http://github.com/visionmedia/should) cleaner.
19
+
20
+ 0.6.4 / 2010-11-02
21
+ ==================
22
+
23
+ * Added regexp support to `assert.response()` headers
24
+ * Removed `waitForExit` code, causing issues
25
+
26
+ 0.6.3 / 2010-11-02
27
+ ==================
28
+
29
+ * Added `assert.response()` body RegExp support
30
+ * Fixed issue with _--serial_ not executing files sequentially. Closes #42
31
+ * Fixed hang when modules use `setInterval` - monitor running tests & force the process to quit after all have completed + timeout [Steve Mason]
32
+
33
+ 0.6.2 / 2010-09-17
34
+ ==================
35
+
36
+ * Added _node-jsocoverage_ to package.json (aka will respect npm's binroot)
37
+ * Added _-t, --timeout_ MS option, defaulting to 2000 ms
38
+ * Added _-s, --serial_
39
+ * __PREFIX__ clobberable
40
+ * Fixed `assert.response()` for latest node
41
+ * Fixed cov reporting from exploding on empty files
42
+
43
+ 0.6.2 / 2010-08-03
44
+ ==================
45
+
46
+ * Added `assert.type()`
47
+ * Renamed `assert.isNotUndefined()` to `assert.isDefined()`
48
+ * Fixed `assert.includes()` param ordering
49
+
50
+ 0.6.0 / 2010-07-31
51
+ ==================
52
+
53
+ * Added _docs/api.html_
54
+ * Added -w, --watch
55
+ * Added `Array` support to `assert.includes()`
56
+ * Added; outputting exceptions immediately. Closes #19
57
+ * Fixed `assert.includes()` param ordering
58
+ * Fixed `assert.length()` param ordering
59
+ * Fixed jscoverage links
60
+
61
+ 0.5.0 / 2010-07-16
62
+ ==================
63
+
64
+ * Added support for async exports
65
+ * Added timeout support to `assert.response()`. Closes #3
66
+ * Added 4th arg callback support to `assert.response()`
67
+ * Added `assert.length()`
68
+ * Added `assert.match()`
69
+ * Added `assert.isUndefined()`
70
+ * Added `assert.isNull()`
71
+ * Added `assert.includes()`
72
+ * Added growlnotify support via -g, --growl
73
+ * Added -o, --only TESTS. Ex: --only "test foo()" --only "test foo(), test bar()"
74
+ * Removed profanity
75
+
76
+ 0.4.0 / 2010-07-09
77
+ ==================
78
+
79
+ * Added reporting source coverage (respects --boring for color haters)
80
+ * Added callback to assert.response(). Closes #12
81
+ * Fixed; putting exceptions to stderr. Closes #13
82
+
83
+ 0.3.1 / 2010-06-28
84
+ ==================
85
+
86
+ * Faster assert.response()
87
+
88
+ 0.3.0 / 2010-06-28
89
+ ==================
90
+
91
+ * Added -p, --port NUM flags
92
+ * Added assert.response(). Closes #11
93
+
94
+ 0.2.1 / 2010-06-25
95
+ ==================
96
+
97
+ * Fixed issue with reporting object assertions
98
+
99
+ 0.2.0 / 2010-06-21
100
+ ==================
101
+
102
+ * Added `make uninstall`
103
+ * Added better readdir() failure message
104
+ * Fixed `make install` for kiwi
105
+
106
+ 0.1.0 / 2010-06-15
107
+ ==================
108
+
109
+ * Added better usage docs via --help
110
+ * Added better conditional color support
111
+ * Added pre exit assertion support
112
+
113
+ 0.0.3 / 2010-06-02
114
+ ==================
115
+
116
+ * Added more room for filenames in test coverage
117
+ * Added boring output support via --boring (suppress colored output)
118
+ * Fixed async failure exit status
119
+
120
+ 0.0.2 / 2010-05-30
121
+ ==================
122
+
123
+ * Fixed exit status for CI support
124
+
125
+ 0.0.1 / 2010-05-30
126
+ ==================
127
+
128
+ * Initial release