traceur-rb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (410) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +2 -2
  3. data/lib/js/compile.js +7 -15
  4. data/lib/traceur.rb +2 -1
  5. data/lib/traceur/compilation_error.rb +27 -0
  6. data/lib/traceur/compiler.rb +4 -1
  7. data/lib/traceur/configuration.rb +1 -1
  8. data/lib/traceur/node/runner.rb +1 -1
  9. data/lib/traceur/version.rb +1 -1
  10. data/spec/examples/syntax_error.js +3 -0
  11. data/spec/integration/examples_spec.rb +6 -0
  12. data/vendor/node_modules/traceur/LICENSE +202 -0
  13. data/vendor/node_modules/traceur/README.md +5 -5
  14. data/vendor/node_modules/traceur/bin/traceur-runtime.js +1392 -623
  15. data/vendor/node_modules/traceur/bin/traceur.js +24749 -17990
  16. data/vendor/node_modules/traceur/node_modules/.bin/semver +2 -2
  17. data/vendor/node_modules/traceur/node_modules/commander/History.md +222 -0
  18. data/vendor/node_modules/traceur/node_modules/commander/Readme.md +127 -35
  19. data/vendor/node_modules/traceur/node_modules/commander/index.js +261 -93
  20. data/vendor/node_modules/traceur/node_modules/commander/package.json +41 -9
  21. data/vendor/node_modules/traceur/node_modules/glob/LICENSE +15 -0
  22. data/vendor/node_modules/traceur/node_modules/glob/README.md +357 -0
  23. data/vendor/node_modules/traceur/node_modules/glob/common.js +177 -0
  24. data/vendor/node_modules/traceur/node_modules/glob/glob.js +649 -0
  25. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
  26. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/LICENSE +15 -0
  27. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/README.md +37 -0
  28. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/inflight.js +44 -0
  29. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
  30. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
  31. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +34 -0
  32. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
  33. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
  34. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/package.json +61 -0
  35. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/test.js +97 -0
  36. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  37. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/README.md +42 -0
  38. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  39. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  40. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/package.json +33 -0
  41. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/test.js +25 -0
  42. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
  43. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
  44. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
  45. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/README.md +216 -0
  46. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
  47. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
  48. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
  49. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
  50. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
  51. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
  52. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
  53. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
  54. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
  55. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/collections → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.travis.yml +0 -0
  56. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
  57. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
  58. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
  59. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
  60. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
  61. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
  62. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/url2 → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/.travis.yml +1 -1
  63. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
  64. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
  65. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
  66. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
  67. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
  68. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
  69. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
  70. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
  71. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
  72. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
  73. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
  74. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
  75. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
  76. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
  77. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
  78. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
  79. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
  80. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
  81. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
  82. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/package.json +60 -0
  83. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
  84. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
  85. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
  86. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  87. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/LICENSE +27 -0
  88. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/README.md +51 -0
  89. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
  90. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
  91. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +34 -0
  92. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
  93. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
  94. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/once.js +21 -0
  95. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/package.json +42 -0
  96. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/test/once.js +23 -0
  97. data/vendor/node_modules/traceur/node_modules/glob/package.json +72 -0
  98. data/vendor/node_modules/traceur/node_modules/glob/sync.js +409 -0
  99. data/vendor/node_modules/traceur/node_modules/rsvp/.release.json +17 -0
  100. data/vendor/node_modules/traceur/node_modules/rsvp/CHANGELOG.md +165 -0
  101. data/vendor/node_modules/traceur/node_modules/rsvp/LICENSE +19 -0
  102. data/vendor/node_modules/traceur/node_modules/rsvp/README.md +364 -0
  103. data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.js +1671 -0
  104. data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.min.js +9 -0
  105. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.js +66 -0
  106. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.umd.js +50 -0
  107. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/-internal.js +265 -0
  108. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all-settled.js +71 -0
  109. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all.js +15 -0
  110. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/asap.js +109 -0
  111. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/config.js +28 -0
  112. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/defer.js +45 -0
  113. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/enumerator.js +125 -0
  114. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/events.js +201 -0
  115. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/filter.js +120 -0
  116. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash-settled.js +124 -0
  117. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash.js +94 -0
  118. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/instrument.js +41 -0
  119. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/map.js +99 -0
  120. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/node.js +281 -0
  121. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise-hash.js +51 -0
  122. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise.js +496 -0
  123. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/all.js +52 -0
  124. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/race.js +105 -0
  125. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/reject.js +47 -0
  126. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/resolve.js +49 -0
  127. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/race.js +15 -0
  128. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/reject.js +16 -0
  129. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/resolve.js +17 -0
  130. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/rethrow.js +46 -0
  131. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/utils.js +39 -0
  132. data/vendor/node_modules/traceur/node_modules/rsvp/package.json +100 -0
  133. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/README.md +9 -0
  134. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/bower.json +22 -0
  135. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/composer.json +18 -0
  136. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/package.json +52 -0
  137. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.amd.js +1607 -0
  138. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.js +1566 -0
  139. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.min.js +26 -0
  140. data/vendor/node_modules/traceur/node_modules/rsvp/vertx.js +1 -0
  141. data/vendor/node_modules/traceur/node_modules/semver/bin/semver +2 -2
  142. data/vendor/node_modules/traceur/node_modules/semver/package.json +4 -3
  143. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +7 -0
  144. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
  145. data/vendor/node_modules/traceur/node_modules/semver/semver.js +7 -0
  146. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -1
  147. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
  148. data/vendor/node_modules/traceur/node_modules/semver/test/index.js +8 -4
  149. data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +2 -1
  150. data/vendor/node_modules/traceur/node_modules/source-map-support/.npmignore +1 -0
  151. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/mime/LICENSE → source-map-support/LICENSE.md} +7 -5
  152. data/vendor/node_modules/traceur/node_modules/source-map-support/README.md +165 -0
  153. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/browser-source-map-support.js +89 -0
  154. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/index.html +6 -0
  155. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/require.js +36 -0
  156. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.coffee +13 -0
  157. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.js +24 -0
  158. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.map +10 -0
  159. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-source-map-support.js +89 -0
  160. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/index.html +6 -0
  161. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.coffee +12 -0
  162. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.js +25 -0
  163. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.map +10 -0
  164. data/vendor/node_modules/traceur/node_modules/source-map-support/build.js +69 -0
  165. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/index.html +6 -0
  166. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.coffee +12 -0
  167. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.js +25 -0
  168. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.map +10 -0
  169. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/server.js +45 -0
  170. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/.npmignore +2 -0
  171. data/vendor/node_modules/traceur/node_modules/{q-io → source-map-support/node_modules/source-map}/.travis.yml +1 -0
  172. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/CHANGELOG.md +121 -0
  173. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/LICENSE +28 -0
  174. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/Makefile.dryice.js +166 -0
  175. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/README.md +434 -0
  176. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js +56 -0
  177. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/mini-require.js +152 -0
  178. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  179. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-utils.jsm +18 -0
  180. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-browser.js +8 -0
  181. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  182. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-utils.jsm +21 -0
  183. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-prefix.js +8 -0
  184. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-suffix.js +3 -0
  185. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map.js +8 -0
  186. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/array-set.js +97 -0
  187. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  188. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64.js +42 -0
  189. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  190. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
  191. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
  192. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js +371 -0
  193. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js +205 -0
  194. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  195. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  196. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  197. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  198. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/package.json +37 -0
  199. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/package.json +142 -0
  200. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/run-tests.js +62 -0
  201. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-api.js +26 -0
  202. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  203. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  204. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64.js +35 -0
  205. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  206. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  207. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
  208. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
  209. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-node.js +365 -0
  210. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/util.js +161 -0
  211. data/vendor/node_modules/traceur/node_modules/source-map-support/package.json +52 -0
  212. data/vendor/node_modules/traceur/node_modules/source-map-support/source-map-support.js +381 -0
  213. data/vendor/node_modules/traceur/node_modules/source-map-support/test.js +359 -0
  214. data/vendor/node_modules/traceur/package.json +234 -20
  215. data/vendor/node_modules/traceur/src/node/NodeCompiler.js +78 -0
  216. data/vendor/node_modules/traceur/src/node/System.js +32 -5
  217. data/vendor/node_modules/traceur/src/node/api.js +28 -93
  218. data/vendor/node_modules/traceur/src/node/command.js +84 -19
  219. data/vendor/node_modules/traceur/src/node/compileAllJsFilesInDir.js +40 -0
  220. data/vendor/node_modules/traceur/src/node/interpreter.js +11 -8
  221. data/vendor/node_modules/traceur/src/node/recursiveModuleCompile.js +171 -0
  222. data/vendor/node_modules/traceur/src/node/require.js +7 -21
  223. data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +2 -7
  224. data/vendor/node_modules/traceur/src/node/to-closure-compiler.js +28 -0
  225. data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +3 -7
  226. data/vendor/node_modules/traceur/src/node/traceur.js +1 -1
  227. metadata +196 -190
  228. data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +0 -1
  229. data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +0 -122
  230. data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +0 -19
  231. data/vendor/node_modules/traceur/node_modules/q-io/README.md +0 -928
  232. data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +0 -59
  233. data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +0 -44
  234. data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +0 -51
  235. data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +0 -307
  236. data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +0 -499
  237. data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +0 -547
  238. data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +0 -105
  239. data/vendor/node_modules/traceur/node_modules/q-io/fs.js +0 -355
  240. data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +0 -65
  241. data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +0 -152
  242. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +0 -24
  243. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +0 -93
  244. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +0 -154
  245. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +0 -178
  246. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +0 -417
  247. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +0 -58
  248. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +0 -78
  249. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +0 -120
  250. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +0 -27
  251. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +0 -209
  252. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +0 -125
  253. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +0 -175
  254. data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +0 -75
  255. data/vendor/node_modules/traceur/node_modules/q-io/http.js +0 -378
  256. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +0 -11
  257. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +0 -78
  258. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +0 -21
  259. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +0 -1285
  260. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +0 -22
  261. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +0 -142
  262. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +0 -57
  263. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +0 -183
  264. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +0 -261
  265. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +0 -186
  266. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +0 -55
  267. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +0 -59
  268. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +0 -236
  269. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +0 -371
  270. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +0 -435
  271. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +0 -247
  272. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +0 -147
  273. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +0 -448
  274. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +0 -139
  275. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +0 -79
  276. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +0 -142
  277. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +0 -60
  278. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +0 -41
  279. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +0 -12
  280. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +0 -7
  281. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +0 -48
  282. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +0 -590
  283. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +0 -49
  284. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +0 -173
  285. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +0 -274
  286. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +0 -59
  287. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +0 -538
  288. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +0 -14
  289. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +0 -6
  290. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +0 -49
  291. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +0 -51
  292. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +0 -269
  293. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +0 -61
  294. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +0 -736
  295. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +0 -40
  296. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +0 -1
  297. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +0 -66
  298. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +0 -114
  299. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +0 -35
  300. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +0 -84
  301. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +0 -1588
  302. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +0 -77
  303. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +0 -15
  304. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +0 -19
  305. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +0 -96
  306. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +0 -166
  307. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +0 -43
  308. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +0 -40
  309. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +0 -19
  310. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +0 -813
  311. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +0 -71
  312. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +0 -36
  313. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +0 -93
  314. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +0 -1937
  315. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +0 -35
  316. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +0 -6
  317. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +0 -36
  318. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +0 -7
  319. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +0 -38
  320. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +0 -32
  321. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +0 -39
  322. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +0 -2
  323. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +0 -123
  324. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +0 -19
  325. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +0 -3
  326. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +0 -3
  327. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +0 -128
  328. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +0 -53
  329. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +0 -61
  330. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +0 -856
  331. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +0 -1080
  332. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +0 -377
  333. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +0 -290
  334. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
  335. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
  336. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +0 -4
  337. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +0 -16
  338. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +0 -12
  339. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +0 -91
  340. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +0 -12
  341. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +0 -13
  342. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +0 -14
  343. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +0 -146
  344. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
  345. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
  346. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +0 -3
  347. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +0 -22
  348. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +0 -6
  349. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +0 -248
  350. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +0 -53
  351. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +0 -2
  352. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +0 -91
  353. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +0 -548
  354. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +0 -8
  355. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +0 -358
  356. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +0 -133
  357. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +0 -3
  358. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +0 -20
  359. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +0 -33
  360. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +0 -37
  361. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +0 -125
  362. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +0 -151
  363. data/vendor/node_modules/traceur/node_modules/q-io/package.json +0 -51
  364. data/vendor/node_modules/traceur/node_modules/q-io/reader.js +0 -133
  365. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +0 -47
  366. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +0 -11
  367. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +0 -1
  368. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +0 -33
  369. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +0 -92
  370. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +0 -41
  371. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +0 -57
  372. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +0 -1
  373. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +0 -70
  374. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +0 -109
  375. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +0 -67
  376. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +0 -219
  377. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +0 -20
  378. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +0 -26
  379. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +0 -40
  380. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +0 -37
  381. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +0 -39
  382. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +0 -32
  383. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +0 -26
  384. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +0 -86
  385. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +0 -31
  386. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +0 -73
  387. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +0 -23
  388. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +0 -1
  389. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +0 -22
  390. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +0 -25
  391. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +0 -45
  392. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +0 -38
  393. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +0 -52
  394. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +0 -86
  395. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +0 -1
  396. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +0 -1
  397. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
  398. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
  399. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +0 -49
  400. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +0 -47
  401. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +0 -186
  402. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +0 -82
  403. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +0 -110
  404. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +0 -96
  405. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +0 -96
  406. data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +0 -42
  407. data/vendor/node_modules/traceur/node_modules/q-io/writer.js +0 -111
  408. data/vendor/node_modules/traceur/src/node/compile-single-file.js +0 -69
  409. data/vendor/node_modules/traceur/src/node/compiler.js +0 -116
  410. data/vendor/node_modules/traceur/src/node/inline-module.js +0 -149
@@ -1,3 +0,0 @@
1
- node_modules
2
- .coverage_data
3
- cover_html
@@ -1,20 +0,0 @@
1
-
2
- Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved.
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to
5
- deal in the Software without restriction, including without limitation the
6
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
- sell copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
- IN THE SOFTWARE.
20
-
@@ -1,33 +0,0 @@
1
-
2
- URL2
3
- ----
4
-
5
- This module builds upon the existing URL module in NodeJS, but adds
6
- `relative(source, target)` which returns the shortest relative path
7
- between any two equally qualified URL’s. If the paths are not equally
8
- qualified, it returns the target.
9
-
10
- In addition, this package augments the URL object definition as returned
11
- by `parse` and consumed by `format`.
12
-
13
- - `pathname` is broken down into
14
- - `root`: whether the path is qualified from the root of the
15
- domain.
16
- - `relative`: the relative path, from the root if `pathname` is
17
- qualified from the domain root.
18
- - `directories`: an array of path components
19
- - `file`: the name of the file, or null if the URL points to a
20
- directory, indicated by a final slash.
21
-
22
- Additionally, `format` uses the `path` property if it exists, instead of
23
- `pathname` and `search`.
24
-
25
- ----
26
-
27
- Based on my earlier work for [Narwhal][].
28
-
29
- [Narwhal]: https://github.com/kriskowal/narwhal-lib/blob/master/lib/narwhal/uri.js
30
-
31
- Copyright 2012 Kristopher Michael Kowal. All rights reserved.
32
- MIT License
33
-
@@ -1,37 +0,0 @@
1
- {
2
- "name": "url2",
3
- "version": "0.0.0",
4
- "description": "Node's URL module plus relative pathing",
5
- "author": {
6
- "name": "Kris Kowal",
7
- "email": "kris@cixar.com",
8
- "url": "https://github.com/kriskowal/url2"
9
- },
10
- "homepage": "https://github.com/kriskowal/url2",
11
- "keywords": [
12
- "url"
13
- ],
14
- "main": "url2.js",
15
- "repository": {
16
- "type": "git",
17
- "url": "git://github.com/kriskowal/url2.git"
18
- },
19
- "devDependencies": {
20
- "jshint": ">=0.9.1",
21
- "jasmine-node": "*",
22
- "cover": "*",
23
- "opener": "*"
24
- },
25
- "scripts": {
26
- "test": "jasmine-node test",
27
- "lint": "jshint url2.js",
28
- "cover": "cover run node_modules/jasmine-node/bin/jasmine-node test && cover report html && opener cover_html/index.html"
29
- },
30
- "readme": "\nURL2\n----\n\nThis module builds upon the existing URL module in NodeJS, but adds\n`relative(source, target)` which returns the shortest relative path\nbetween any two equally qualified URL’s. If the paths are not equally\nqualified, it returns the target.\n\nIn addition, this package augments the URL object definition as returned\nby `parse` and consumed by `format`.\n\n- `pathname` is broken down into\n - `root`: whether the path is qualified from the root of the\n domain.\n - `relative`: the relative path, from the root if `pathname` is\n qualified from the domain root.\n - `directories`: an array of path components\n - `file`: the name of the file, or null if the URL points to a\n directory, indicated by a final slash.\n\nAdditionally, `format` uses the `path` property if it exists, instead of\n`pathname` and `search`.\n\n----\n\nBased on my earlier work for [Narwhal][].\n\n[Narwhal]: https://github.com/kriskowal/narwhal-lib/blob/master/lib/narwhal/uri.js\n\nCopyright 2012 Kristopher Michael Kowal. All rights reserved.\nMIT License\n\n",
31
- "readmeFilename": "README.md",
32
- "bugs": {
33
- "url": "https://github.com/kriskowal/url2/issues"
34
- },
35
- "_id": "url2@0.0.0",
36
- "_from": "url2@~0.0.0"
37
- }
@@ -1,125 +0,0 @@
1
-
2
- var URL = require("../url2");
3
-
4
- var tests = [
5
-
6
- {
7
- source: "",
8
- target: "",
9
- relative: ""
10
- },
11
-
12
- {
13
- source: "foo/bar/",
14
- target: "foo/bar/",
15
- relative: ""
16
- },
17
-
18
- {
19
- source: "foo/bar/baz",
20
- target: "foo/bar/",
21
- relative: "./"
22
- },
23
-
24
- {
25
- source: "foo/bar/",
26
- target: "/foo/bar/",
27
- relative: "/foo/bar/"
28
- },
29
-
30
- {
31
- source: "/foo/bar/baz",
32
- target: "/foo/bar/quux",
33
- relative: "quux"
34
- },
35
-
36
- {
37
- source: "/foo/bar/baz",
38
- target: "/foo/bar/quux/asdf",
39
- relative: "quux/asdf"
40
- },
41
-
42
- {
43
- source: "/foo/bar/baz",
44
- target: "/foo/bar/quux/baz",
45
- relative: "quux/baz"
46
- },
47
-
48
- {
49
- source: "/foo/bar/baz",
50
- target: "/foo/quux/baz",
51
- relative: "../quux/baz"
52
- },
53
-
54
- {
55
- source: "/foo/bar/baz",
56
- target: "/foo/quux/baz?a=10",
57
- relative: "../quux/baz?a=10"
58
- },
59
-
60
- {
61
- source: "/foo/bar/baz?a=10",
62
- target: "/foo/quux/baz?a=10",
63
- relative: "../quux/baz?a=10"
64
- },
65
-
66
- {
67
- source: "/foo/bar/baz?b=20",
68
- target: "/foo/quux/baz?a=10",
69
- relative: "../quux/baz?a=10"
70
- },
71
-
72
- {
73
- source: "http://example.com",
74
- target: "/foo/bar",
75
- relative: "/foo/bar"
76
- },
77
-
78
- {
79
- source: "",
80
- target: "http://example.com/foo/bar",
81
- relative: "http://example.com/foo/bar"
82
- },
83
-
84
- {
85
- source: "",
86
- target: "#foo",
87
- relative: "#foo"
88
- },
89
-
90
- {
91
- source: "",
92
- target: "?a=10",
93
- relative: "?a=10"
94
- },
95
-
96
- {
97
- source: "?a=10",
98
- target: "#foo",
99
- relative: "?a=10#foo"
100
- }
101
-
102
- ];
103
-
104
- describe("relative", function () {
105
-
106
- tests.forEach(function (test) {
107
- it(
108
- test.label || (
109
- "from " + JSON.stringify(test.source) + " " +
110
- "to " + JSON.stringify(test.target)
111
- ),
112
- function () {
113
- expect(URL.relative(test.source, test.target))
114
- .toBe(test.relative)
115
- }
116
- )
117
- });
118
-
119
- it("should format a url with a path property", function () {
120
- expect(URL.format({path: "a/b"})).toEqual("a/b");
121
- expect(URL.format({path: "a/b?c=d"})).toEqual("a/b?c=d");
122
- });
123
-
124
- });
125
-
@@ -1,151 +0,0 @@
1
-
2
- var URL = require("url");
3
-
4
- // Node’s URL parse produces:
5
- // http://user:password@foo.com:8080/path/to/foo/bar?a=10&c=20&d=30#hash
6
- // ^ ^^^^- auth ----^ ^-----^ |^- pathname----^^- search-----^^ ^
7
- // | ||| hostname | ^- query ----^| |
8
- // proto|| | ^--^^- path ----------------------^| |
9
- // | slashes | port hash^
10
- // | ^- host ---^ |
11
- // ^- href ------------------------------------------------------------^
12
-
13
- // Node's URL format uses:
14
- // protocol: gets a colon added if it doesn't have one yet
15
- // slashes: used
16
- // auth: used
17
- // hostname: used if there's no host
18
- // port: used if there's no host
19
- // path: NOT USED AT ALL EVER
20
- // pathname: used
21
- // search: used
22
- // query: used if object and no search
23
- // hash: used
24
-
25
- exports.resolve = URL.resolve;
26
- exports.resolveObject = URL.resolveObject;
27
-
28
- exports.parse = parse;
29
- function parse(url) {
30
- var object = URL.parse(url);
31
- object.pathname = object.pathname || "";
32
- object.root = !!object.pathname.length && object.pathname[0] === "/";
33
- if (object.root) {
34
- object.relative = object.pathname.slice(1);
35
- } else {
36
- object.relative = object.pathname;
37
- }
38
- if (object.relative.length) {
39
- object.directories = object.relative.split("/");
40
- object.file = object.directories.pop();
41
- } else {
42
- object.directories = [];
43
- object.file = null;
44
- }
45
- return object;
46
- }
47
-
48
- exports.format = format;
49
- function format(object) {
50
-
51
- if ("file" in object) {
52
- object.directories.push(object.file);
53
- delete object.file;
54
- }
55
-
56
- if ("directories" in object) {
57
- object.relative = object.directories.join("/");
58
- delete object.directories;
59
- }
60
-
61
- if ("relative" in object) {
62
- if (object.root) {
63
- object.pathname = "/" + object.relative;
64
- } else {
65
- object.pathname = object.relative;
66
- }
67
- delete object.relative;
68
- }
69
-
70
- if (object.path != null) {
71
- var index = object.path.indexOf("?");
72
- if (index == -1) {
73
- object.pathname = object.path;
74
- object.search = "";
75
- } else {
76
- object.pathname = object.path.slice(0, index);
77
- object.search = object.path.slice(index);
78
- }
79
- }
80
-
81
- return URL.format(object);
82
- }
83
-
84
- exports.relativeObject = relativeObject;
85
- function relativeObject(source, target) {
86
- source = parse(source);
87
- target = parse(target);
88
-
89
- delete target.href;
90
-
91
- if (
92
- target.protocol === source.protocol &&
93
- target.slashes === source.slashes &&
94
- target.auth === source.auth &&
95
- target.host === source.host
96
- ) {
97
- delete target.protocol;
98
- delete target.slashes;
99
- delete target.auth;
100
- delete target.hostname;
101
- delete target.port;
102
- delete target.host;
103
-
104
- if (
105
- !!target.root == !!source.root && !(
106
- target.root &&
107
- target.directories[0] != source.directories[0]
108
- )
109
- ) {
110
- delete target.path;
111
- delete target.root;
112
- while (
113
- source.directories.length &&
114
- target.directories.length &&
115
- target.directories[0] == source.directories[0]
116
- ) {
117
- target.directories.shift();
118
- source.directories.shift();
119
- }
120
- while (source.directories.length) {
121
- source.directories.shift();
122
- target.directories.unshift('..');
123
- }
124
-
125
- if (
126
- !target.root &&
127
- !target.directories.length &&
128
- !target.file && source.file
129
- ) {
130
- target.directories.push('.');
131
- }
132
-
133
- if (
134
- target.directories.length === 0 &&
135
- target.file === null &&
136
- source.search
137
- ) {
138
- target.search = source.search;
139
- }
140
-
141
- }
142
- }
143
-
144
- return target;
145
- }
146
-
147
- exports.relative = relative;
148
- function relative(source, target) {
149
- return format(relativeObject(source, target));
150
- }
151
-
@@ -1,51 +0,0 @@
1
- {
2
- "name": "q-io",
3
- "version": "1.10.9",
4
- "description": "IO using Q promises",
5
- "homepage": "http://github.com/kriskowal/q-io/",
6
- "author": {
7
- "name": "Kris Kowal",
8
- "email": "kris@cixar.com",
9
- "url": "http://github.com/kriskowal/"
10
- },
11
- "bugs": {
12
- "url": "http://github.com/kriskowal/q-io/issues"
13
- },
14
- "licenses": [
15
- {
16
- "type": "MIT",
17
- "url": "http://github.com/kriskowal/q-io/raw/master/LICENSE"
18
- }
19
- ],
20
- "repository": {
21
- "type": "git",
22
- "url": "http://github.com/kriskowal/q-io.git"
23
- },
24
- "dependencies": {
25
- "q": "~0.9.7",
26
- "qs": "~0.1.0",
27
- "url2": "~0.0.0",
28
- "mime": "~1.2.11",
29
- "mimeparse": "~0.1.4",
30
- "collections": "~0.2.0"
31
- },
32
- "devDependencies": {
33
- "jshint": "~0.9.1",
34
- "cover": "~0.2.8",
35
- "jasmine-node": "~1.7",
36
- "opener": "~1.3"
37
- },
38
- "scripts": {
39
- "test": "jasmine-node spec",
40
- "test-browser": "opener spec/q-spec.html",
41
- "lint": "jshint q.js",
42
- "cover": "cover run jasmine-node spec && cover report html && opener cover_html/index.html"
43
- },
44
- "engines": {
45
- "node": ">=0.6.0"
46
- },
47
- "readme": "\n[![Build Status](https://secure.travis-ci.org/kriskowal/q-io.png)](http://travis-ci.org/kriskowal/q-io)\n\n# Q-IO\n\nInterfaces for IO that make use of promises.\n\nQ-IO now subsumes all of [Q-HTTP][] and [Q-FS][].\n\n[Q-HTTP]: https://github.com/kriskowal/q-http\n[Q-FS]: https://github.com/kriskowal/q-fs\n\nThe Q-IO package does not export a main module. You must reach in\ndirectly for `q-io/fs`, `q-io/http`, and `q-io/http-apps`.\n\n## Filesystem\n\n```javascript\nvar FS = require(\"q-io/fs\");\n```\n\nFile system API for Q promises with method signatures patterned after\n[CommonJS/Fileystem/A](http://wiki.commonjs.org/wiki/Filesystem/A) but\nreturning promises and promise streams.\n\n### open(path, options)\n\nOpen returns a promise for either a buffer or string Reader or a Writer\ndepending on the flags.\n\nThe options can be omitted, abbreviated to a `flags` string, or expanded\nto an `options` object.\n\n- ``flags``: ``r``, ``w``, ``a``, ``b``, default of `r`, not bytewise\n- ``charset``: default of ``utf-8``\n- ``bufferSize``: in bytes\n- ``mode``: UNIX permissions\n- ``begin`` first byte to read (defaults to zero)\n- ``end`` one past the last byte to read. ``end - begin == length``\n\n### read(path, options)\n\n`read` is a shortcut for opening a file and reading the entire contents\ninto memory. It returns a promise for the whole file contents. By\ndefault, `read` provides a string decoded from UTF-8. With the bytewise\nmode flag, provides a `Buffer`.\n\nThe options argument is identical to that of `open`. \n\n```javascript\nreturn FS.read(__filename, \"b\")\n.then(function (content) {\n // ...\n})\n```\n\n```javascript\nreturn FS.read(__filename, {\n flags: \"b\"\n})\n```\n\n### write(path, content, options)\n\n`write` is a shortcut for opening a file and writing its entire content\nfrom a single string or buffer.\n\nThe options are identical to that of `open`, but the \"w\" flag is\nimplied, and the \"b\" flag is implied if the content is a buffer.\n\n```javascript\nreturn FS.write(\"hello.txt\", \"Hello, World!\\n\")\n.then(function () {\n return FS.read(\"hello.txt\")\n})\n.then(function (hello) {\n expect(hello).toBe(\"Hello, World!\\n\")\n})\n```\n\n### append(path, content, options)\n\n`append` is a shorthand for opening a file for writing from the end of\nthe existing content from a single string or buffer.\n\nThe options are identical to that of `open`, but the \"w+\" flags are\nimplied, and the \"b\" flag is implied if the content is a buffer.\n\n### copy(source, target)\n\nCopies a single file from one path to another. The target must be the\nfull path, including the file name. Unlike at the shell, the file name\nis not inferred from the source path if the target turns out to be a\ndirectory.\n\nReturns a promise for the completion of the operation.\n\n### copyTree(source, target)\n\nCopies a file or tree of files from one path to another. Symbolic links\nare copied but not followed.\n\nReturns a promise for the completion of the operation.\n\n### list(path)\n\nReturns a promise for a list of file names in a directory. The file\nnames are relative to the given path.\n\n### listTree(path, guard(path, stat))\n\nReturns a promise for a list of files in a directory and all the\ndirectories it contains. Does not follow symbolic links.\n\nThe second argument is an optional guard function that determines what\nfiles to include and whether to traverse into another directory. It\nreceives the path of the file, relative to the starting path, and also\nthe stats object for that file. The guard must return a value like:\n\n- `true` indicates that the entry should be included\n- `false` indicates that the file should be excluded, but should still\n be traversed if it is a directory.\n- `null` indiciates that a directory should not be traversed.\n\n### listDirectoryTree(path)\n\nReturns a promise for a deep list of directories.\n\n### makeDirectory(path, mode)\n\nMakes a directory at a given path. Fails if the parent directory does\nnot exist. Returns a promise for the completion of the operation.\n\nThe mode is an optional Unix mode as an integer or string of octal\ndigits.\n\n### makeTree(path, mode)\n\nFinishes a path of directories. For any branch of the path that does\nnot exist, creates a directory. Fails if any branch of the path already\nexists but is not a directory.\n\nMakes any directories with the given Unix mode.\n\n### remove(path)\n\nRemoves a file at the given path. Fails if a directory exists at the\ngiven path or if no file exists at the path.\n\n### removeTree(path)\n\nRemoves a file or directory at a given path, recursively removing any\ncontained files and directories, without following symbolic links.\n\n### rename(source, target)\n\nMoves a file or directory from one path to another using the underlying\n`rename(2)` implementation, thus it cannot move a file across devices.\n\n### move(source, target)\n\nMoves a file or directory from one path to another. If the source and\ntarget are on different devices, falls back to copying and removing,\nusing `copyTree(source, target)` and, if completely successful,\n`removeTree(source)`.\n\n### link(source, taget)\n\nCreates a hard link from the source\n\n### symbolicCopy(source, target, type)\n\nCreates a relative symoblic link from the target to the source with an\neffect that resembles copying a file.\n\nThe type is important for Windows. It is \"file\" by default, but may be\n\"directory\" or \"junction\".\n\n### symbolicLink(target, link, type)\n\nCreates a symbolic link at the target path. The link may be absolute or\nrelative. The type *must* be \"file\", \"directory\", or \"junction\" and is\nmandatory to encourage Windows portability.\n\n### chown(path, uid, gid)\n\nChanges the owner for a path using Unix user-id and group-id numbers.\n\n### chmod(path, mode)\n\nChanges the Unix mode for a path. Returns a promise.\n\n### stat(path)\n\nFollows all symoblic links along a path and returns a promise for the\nmetadata about a path as a `Stats` object. The Stats object implements:\n\n- `size` the size of the file in bytes\n- `isDirectory()`: returns whether the path refers to a directory with\n entries for other paths.\n- `isFile()`: returns whether the path refers to a file physically\n stored by the file system.\n- `isBlockDevice()`: returns whether the path refers to a Unix device\n driver, in which case there is no actual data in storage but the\n operating system may allow you to communicate with the driver as a\n blocks of memory.\n- `isCharacterDevice()`: returns whether the path refers to a Unix\n device driver, in which case there is no actual data in storage but\n the operating system may allow you to communicate with the driver as\n a stream.\n- `isSymbolicLink()`: returns whether the path refers to a symbolic\n link or junction. Stats for symbolic links are only discoverable\n through `statLink` since `stat` follows symbolic links.\n- `isFIFO()`: returns whether the path refers to a Unix named pipe.\n- `isSocket()`: returns whether the path refers to a Unix domain\n socket.\n- `lastModified()`: returns the last time the path was opened for\n writing as a `Date`\n- `lastAccessed()`: returns the last time the path was opened for\n reading or writing as a `Date`\n\n### statLink(path)\n\nReturns a promise for the `Stats` for a path without following symbolic\nlinks.\n\n### statFd(fd)\n\nReturns a promise for the `Stats` for a Unix file descriptor number.\n\n### exists(path)\n\nFollows symoblic links and returns a promise for whether an entry exists\nat a given path.\n\n### isFile(path)\n\nFollows symbolic links and returns a promise for whether a file exists\nat a given path and does not cause an exception if nothing exists at\nthat path.\n\n### isDirectory(path)\n\nFollows symbolic links and returns a promise for whether a directory\nexists at a given path and does not cause an exception if nothing exists\nat that path.\n\n### isSymbolicLink(path)\n\nReturns a promise for whether a symbolic link exists at a given path and\ndoes not cause an exception if nothing exists at that path.\n\n### lastModified(path)\n\nFollows symbolic links and returns a promise for the `Date` when the\nentry at the given path was last opened for writing, but causes an\nexception if no file exists at that path.\n\n### lastAccessed(path)\n\nFollows symbolic links and returns a promise for the `Date` when the\nentry at the given path was last opened for reading or writing, but\ncauses an exception if no file exists at that path.\n\n### split(path)\n\nSplits a path into the names of entries along the path. If the path is\nabsolute, the first component is either a drive (with a colon) on\nWindows or an empty string for the root of a Unix file system.\n\n### join(paths) or join(...paths)\n\nJoins a sequence of paths into a single normalized path. All but the\nlast path are assumed to refer to directories.\n\n### resolve(...paths)\n\nLike join but treats each path like a relative URL, so a terminating\nslash indicates that a path is to a directory and the next path begins\nat that directory.\n\n### normal(...paths)\n\nTakes a single path or sequence of paths and joins them into a single\npath, eliminating self `.` and parent `..` entries when possible.\n\n### absolute(path)\n\nJoins and normalizes a path from the current working directory,\nreturning a string.\n\n### canonical(path)\n\nReturns a promise for the absolute, canonical location of a given path,\nfollowing symbolic links and normalizing path components. An entry does\nnot need to exist at the end of the path.\n\n### readLink(path)\n\nReturns a promise for the path string of a symbolic link at a given\npath.\n\n### contains(parent, child)\n\nFor any two absolute or relative paths, computes whether the parent path\nis an ancestor of the child path.\n\n### relative(source, target)\n\nReturns a promise for the relative path from one path to another using\n`..` parent links where necessary. This operation is asynchronous\nbecause it is necessary to determine whether the source path refers to a\ndirectory or a file.\n\n### relativeFromFile(source, target)\n\nAssuming that the source path refers to a file, returns a string for the\nrelative path from the source to the target path.\n\n### relativeFromDirectory(source, target)\n\nAssuming that the source path refers to a directory, returns a string\nfor the relative path from the source to the target path.\n\n### isAbsolute(path)\n\nReturns whether a path begins at the root of a Unix file system or a\nWindows drive.\n\n### isRelative(path)\n\nReturns whether a path does not begin at the root of a Unix file system\nor Windows drive.\n\n### isRoot(path)\n\nReturns whether a path is to the root of a Unix file system or a Windows\ndrive.\n\n### root(path)\n\nReturns the Windows drive that contains a given path, or the root of a\nUnix file system.\n\n### directory(path)\n\nReturns the path to the directory containing the given path.\n\n### base(path, extension)\n\nReturns the last entry of a path. If an extension is provided and\nmatches the extension of the path, removes that extension.\n\n### extension(path)\n\nReturns the extension for a path (everything following the last dot `.`\nin a path, unless that dot is at the beginning of the entry).\n\n### reroot(path)\n\nReturns an attenuated file system that uses the given path as its root.\nThe resulting file system object is identical to the parent except that\nthe child cannot open any file that is not within the root. Hard links\nare effectively inside the root regardless, but symbolic links cannot be\nfollowed outside of the jail.\n\n### toObject(path)\n\nReads every file in the file system under a given path and returns a\npromise for an object that contains the absolute path and a Buffer for\neach of those files.\n\n### glob(pattern)\n\nNot yet implemented\n\n### match(pattern, path)\n\nNot yet implemented\n\n## Mock Filesystem\n\nQ-IO provides a mock filesystem interface. The mock filesystem has the\nsame interface as the real one and has most of the same features, but\noperates on a purely in-memory, in-process, in-javascript filesystem.\n\nA mock filesystem can be created from a data structure. Objects are\ndirectories. Keys are paths. A buffer is a file’s contents. Anything\nelse is coerced to a string, then to a buffer in the UTF-8 encoding.\n\n```javascript\nvar MockFs = require(\"q-io/fs-mock\");\nvar mockFs = MockFs({\n \"a\": {\n \"b\": {\n \"c.txt\": \"Content of a/b/c.txt\"\n }\n },\n \"a/b/d.txt\": new Buffer(\"Content of a/b/d.txt\", \"utf-8\")\n})\n```\n\nYou can also instantiate a mock file system with the content of a\nsubtree of a real file system. You receive a promise for the mock\nfilesystem.\n\n```javascript\nvar FS = require(\"q-io/fs\");\nFS.mock(__dirname)\n.then(function (fs) {\n //\n})\n.done();\n```\n\n## HTTP\n\nThe HTTP module resembles [CommonJS/JSGI][].\n\n```javascript\nvar HTTP = require(\"q-io/http\");\n```\n\n[CommonJS/JSGI]: http://wiki.commonjs.org/wiki/JSGI\n\n### Server(app)\n\nThe `http` module exports a `Server` constructor.\n\n- accepts an application, returns a server.\n- calls the application function when requests are received.\n - if the application returns a response object, sends that\n response.\n- ``listen(port)``\n - accepts a port number.\n - returns a promise for undefined when the server has begun\n listening.\n- ``stop()``\n - returns a promise for undefined when the server has stopped.\n\n### request(request object or url)\n\nThe `http` module exports a `request` function that returns a promise\nfor a response.\n\n- accepts a request or a URL string.\n- returns a promise for a response.\n\n### read(request object or url)\n\nThe `http` module exports a `read` function, analogous to\n`Fs.read(path)`, but returning a promise for the contento of an OK HTTP\nresponse.\n\n- accepts a request or a URL string.\n- returns a promise for the response body as a string provided\n that the request is successful with a 200 status.\n - rejects the promise with the response as the reason for\n failure if the request fails.\n\n### normalizeRequest(request object or url)\n\n- coerces URLs into request objects.\n- completes an incomplete request object based on its `url`.\n\n### normalizeResponse(response)\n\n- coerces strings, arrays, and other objects supporting\n ``forEach`` into proper response objects.\n- if it receives `undefined`, it returns `undefined`. This is used as\n a singal to the requester that the responder has taken control of\n the response stream.\n\n### request\n\nA complete request object has the following properties.\n\n- ``url`` the full URL of the request as a string\n- ``path`` the full path as a string\n- ``scriptName`` the routed portion of the path, like ``\"\"`` for\n ``http://example.com/`` if no routing has occurred.\n- ``pathInfo`` the part of the path that remains to be routed,\n like ``/`` for ``http://example.com`` or ``http://example.com/``\n if no routing has occurred.\n- ``version`` the requested HTTP version as an array of strings.\n- ``method`` like ``\"GET\"``\n- ``scheme`` like ``\"http:\"``\n- ``host`` like ``\"example.com\"``\n- ``port`` the port number, like ``80``\n- ``remoteHost``\n- ``remotePort``\n- ``headers``\n corresponding values, possibly an array for multiple headers\n of the same name.\n- ``agent``\n a custom node [HTTP](http://nodejs.org/api/http.html#http_class_http_agent)\n or [HTTPS](http://nodejs.org/api/https.html#https_class_https_agent)\n agent. HTTP and HTTPS agents can implement custom socket pools,\n allow use of SSL client certificates and self-signed certificates.\n- ``body``\n- ``node`` the wrapped Node request object\n\n### response\n\nA complete response object has the following properties.\n\n- ``status`` the HTTP status code as a number, like ``200``.\n- ``headers``\n- ``body`` an IO reader\n- ``onclose`` is an optional function that this library will call\n when a response concludes.\n- ``node`` the wrapped Node response object.\n\n### headers\n\nHeaders are an object mapping lower-case header-names to corresponding\nvalues, possibly an array for multiple headers of the same name, for\nboth requests and responses.\n\n### body\n\nbody is a representation of a readable stream, either for the content of\na request or a response. It is implemented as a Q-IO reader.\n\n- ``forEach(callback)``\n - accepts a ``callback(chunk)`` function\n - accepts a chunk as either a string or a ``Buffer``\n - returns undefined or a promise for undefined when the\n chunk has been flushed.\n - returns undefined or a promise for undefined when the stream\n is finished writing.\n - the ``forEach`` function for arrays of strings or buffers is\n sufficient for user-provided bodies\n- the ``forEach`` function is the only necessary function for\n bodies provided to this library.\n- in addition to ``forEach``, bodies provided by this library\n support the entire readable stream interface provided by\n ``q-io``.\n- ``read()``\n - returns a promise for the entire body as a string or a\n buffer.\n\n### application\n\nAn HTTP application is a function that accepts a request and returns a\nresponse. The `request` function itself is an application.\nApplications can be chained and combined to make advanced servers and\nclients.\n\n- accepts a request\n- returns a response, a promise for a response, or nothing if no\n response should be sent.\n\n\n## Streams\n\n### Reader\n\nReader instances have the following methods:\n\n- `read()`\n- `forEach(callback)`\n- `close()`\n- `node` the underlying node reader\n\nAdditionally, the `Reader` constructor has the following methods:\n\n- `read(stream, charset)` accepts any foreachable and returns either a\n buffer or a string if given a charset.\n- `join(buffers)` consolidates an array of buffers into a single\n buffer. The buffers array is collapsed in place and the new first\n and only buffer is returned.\n\nThe `reader` module exports a function that accepts a Node reader and\nreturns a Q reader.\n\n### Writer\n\nWriter instances have the following methods:\n\n- `write(content)` writes a chunk of content, either from a string or\n a buffer.\n- `flush()` returns a promise to drain the outbound content all the\n way to its destination.\n- `close()`\n- `destroy()`\n- `node` the underlying node writer\n\nThe `writer` module exports a function that accepts a Node writer and\nreturns a Q writer.\n\n### Buffer\n\n```javascript\nvar BufferStream = require(\"q-io/buffer-stream\");\nvar stream = BufferStream(new Buffer(\"Hello, World!\\n\", \"utf-8\"), \"utf-8\")\n```\n\n## HTTP Applications\n\nThe HTTP applications module provides a comprehensive set of JSGI-alike\napplications and application factories, suitable for use with the `http`\nserver and client.\n\n```javascript\nvar Apps = require(\"q-io/http-apps\");\n```\n\n### ok(content, contentType, status) : Response\n\nCreates an `HTTP 200 Ok` response with the given content, content type,\nand status.\n\nThe content may be a string, buffer, array of strings, array of buffers,\na readable stream of strings or buffers, or (generally) anything that\nimplements `forEach`.\n\nThe default content type is `text/plain`.\n\nThe default status is `200`.\n\n### badRequest(request) : Response\n\nAn application that returns an `HTTP 400 Bad request` response for any\nrequest.\n\n### notFound(request) : Response\n\nAn application that returns an `HTTP 404 Not found` response for any\nrequest.\n\n### methodNotAllowed(request) : Response\n\nAn application that returns an `HTTP 405 Method not allowed` response\nfor any request. This is suitable for any endpoint where there is no\nviable handler for the request method.\n\n### notAcceptable(request) : Response\n\nAn application that returns an `HTTP 406 Not acceptable` response for\nany request. This is suitable for any situation where content\nnegotiation has failed, for example, if you cannot response with any of\nthe accepted encoding, charset, or language.\n\n### redirect(request, location, status, tree) : Response\n\nNot to be confused with an HTTP application, this is a utility that\ngenerates redirect responses.\n\nThe returns response issues a redirect to the given location. The\nutility fully qualifies the location.\n\nThis particular method should be used directly to generate an `HTTP 301\nTemporary redirect` response, but passing `307` in the status argument\nturns it into an `HTTP 307 Permanent redirect` response.\n\nThis particular method should be used to send all requests to a specific\nlocation, but setting the `tree` argument to `true` causes the redirect\nto follow the remaining unrouted path from the redirect location, so if\nyou move an entire directory tree from one location to another, this\nredirect can forward to all of them.\n\n### redirectTree(request, location) : Response\n\nProduces an `HTTP 301 Temporary redirect` from one directory tree to\nanother, using `redirect`.\n\n### permanentRedirect(request, location) : Response\n\nProduces an `HTTP 307 Permanent redirect` to a given location, using\n`redirect`.\n\n### permanentRedirectTree(request, location) : Response\n\nProduces an `HTTP 307 Permanent redirect` from one directory tree to\nanother, using `redirect`.\n\n### file(request, path, contentType) : Response\n\nProduces an HTTP response with the file at a given path. By default, it\ninfers the content type from the extension of the path.\n\nThe file utility produces an `e-tag` header suitable for cache control,\nand may produce an `HTTP 304 Not modified` if the requested resource has\nthe same entity tag.\n\nThe file utility may produce an `HTTP 206 Partial content` response with\na `content-range` header if the request has a `range` header. If the\npartial range request cannot be satisified, it may respond `HTTP 416 Not\nsatisfiable`.\n\nIn all cases, the response body is streamed from the file system.\n\n### etag(stat)\n\nComputes an entity tag for a file system `Stats` object, using the\n`node.ino`, `size`, and last modification time.\n\n### directory(request, path)\n\nThis is not yet implemented.\n\n### json(object, visitor, tabs) : Response\n\nReturns an `HTTP 200 Ok` response from some JSON, using the same\nargumensts as `JSON.stringify`.\n\n### Content(body, contentType, status) : Application\n\nA factory that produces an HTTP application that will always respond\nwith the given content, content type, and status. The default content\ntype is `text/plain` and the default status is `200`.\n\nThe body may be a string, array of strings or buffers, or a readable\nstream of strings or buffers.\n\n### File(path, contentType) : Application\n\nA factory that produces an HTTP application that will always respond\nwith the file at the given path. The content type is inferred from the\npath extension by default, but can be overridden with `contentType`.\n\n### FileTree(path, options) : Application\n\nA factory that produces an HTTP application that responds to all\nrequests with files within a branch of the file system starting at the\ngiven path and using any unprocessed portion of the request location.\n\nOptions include:\n\n- `notFound(request, response)`: alternate 404 responder, defaults to\n `HttpApps.notFound`\n- `file(request, path, contentType, fs)`: alternate file responder,\n defaults to `HttpApps.file`\n- `contentType`: forces the content type of file requests, forwarded\n to the `file` handler.\n- `directory(request, path, contentType, fs)`: alternate directory\n responder, defaults to `HttpApps.directory`.\n- `redirectSymbolicLinks`: directs the client to use a redirect\n response for symbolic links instead of following links internally.\n- `permanent`: symbolic links that are turned into HTTP redirects will\n be permanent.\n- `followInsecureSymbolicLinks`: directs `FileTree` to serve files\n that are outside the root path of the file tree if a symbolic link\n traverses there.\n- `fs`: alternate file system, defaults to the `fs` module.\n\n### Redirect(path) : Application\n\nA factory that produces an HTTP application that temporarily redirects\nto the given path.\n\n### RedirectTree(path) : Application\n\nA factory that produces an HTTP application that redirects all requests\nunder the requested path to parallel locations at the given path.\n\n### PermanentRedirect(path) : Application\n\nA factory that produces an HTTP application that redirects all requests\nto an exact location and instructs the requester's cache never to ask\nagain.\n\n### PermanentRedirectTree(path) : Application\n\nA factory that produces an HTTP application that redirects all requests\nunder the request path to a parallel location under the given path and\ninstructs the requester's cache never to ask again.\n\n### Cap(app, notFound) : Application\n\nA factory that produces an HTTP application that will cause an `HTTP 404\nNot found` response if the request has not reached the end of its route\n(meaning `pathInfo` is not `\"\"` or `\"/\"`), or will forward to the given\napplication.\n\n### Routing\n\nSeveral routing application factories have the same form. They all take\nan object as their first argument and an optional fallback application\nas their second. The object maps each of the supported options for keys\nto an HTTP application for handling that option.\n\n- Branch(paths, notFound) routes the next unprocessed path component\n- Method(methods, notFound) routes the HTTP method. Methods are\n upper-case.\n- ContentType(contentTypes, notAcceptable) routes based on the\n \"accept\" request header and produces a \"content-type\" response\n header.\n- Langauge(languages, notAcceptable) routes based on the\n \"accept-language\" header and produces a \"language\" response header.\n- Charaset(charsets, notAcceptable) routes based on the\n \"accept-charset\" header and produces a \"charset\" response header.\n- Encoding(encodings, notAcceptable) routes based on the\n \"accept-encoding\" request header and produces an \"encoding\" response\n header.\n- Host(hosts, notFound) routes based on the host name of the request\n \"host\" header, which defaults to \"*\". This is equivalent to virtual\n host mapping.\n\n### Select(selector) : Application\n\nProduces an HTTP application that uses a function to determine the next\napplication to route. The `selector` is a function that accepts the\nrequest and returns an HTTP application.\n\n### FirstFound(apps)\n\nReturns an HTTP application that attempts to respond with each of a\nseries of applications and returns the first response that does not have\na `404 Not found` status, or whatever response comes last.\n\n### Error(application, debug) : Application\n\nWraps an application such that any exceptions get converted into `HTTP\n500 Server error` responses. If `debug` is enabled, produces the\nexception and stack traces in the body of the response.\n\n### Log(application, log, stamp) : Application\n\nWraps an application such that request and response times are logged.\nThe `log` function reports to `console.log` by default. The\n`stamp(message)` function prefixes an ISO time stamp by default.\n\n### Time(application) : Application\n\nAdds an `x-response-time` header to the response, with the time from receiving\nstarting the request to starting the response in miliseconds.\n\n### Date(application) : Application\n\nAdds a `date` header to the response with the current date for cache\ncontrol purposes.\n\n### Tap(app, tap) : Application\n\nWraps an application such that the `tap` function receives the request\nfirst. If the tap returns nothing, the request goes to the `app`. If\nthe `tap` returns a response, the `app` never gets called.\n\n### Trap(app, trap) : Application\n\nWraps an application such that the `trap` function receives the\nresponse. If it returns nothing, the response if forwarded. If the\n`trap` returns a response, the original response is discarded.\n\n### ParseQuery(application)\n\nWraps an application such that the query string is parsed and placed in\n`request.parse`.\n\n\n## Coverage\n\nUse `npm run cover` to generate and view a coverage report of Q-IO.\n\n<table>\n <thead>\n <tr>\n <th>File</th>\n <th>Percentage</th>\n <th>Missing</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code>fs-boot.js</code></td>\n <td>87%</td>\n <td>41</td>\n </tr>\n <tr>\n <td><code>fs.js</code></td>\n <td>72%</td>\n <td>100</td>\n </tr>\n <tr>\n <td><code>reader.js</code></td>\n <td>94%</td>\n <td>8</td>\n </tr>\n <tr>\n <td><code>writer.js</code></td>\n <td>91%</td>\n <td>8</td>\n </tr>\n <tr>\n <td><code>fs-common.js</code></td>\n <td>87%</td>\n <td>52</td>\n </tr>\n <tr>\n <td><code>fs-root.js</code></td>\n <td>88%</td>\n <td>11</td>\n </tr>\n <tr>\n <td><code>fs-mock.js</code></td>\n <td>91%</td>\n <td>46</td>\n </tr>\n <tr>\n <td><code>buffer-stream.js</code></td>\n <td>89%</td>\n <td>6</td>\n </tr>\n <tr>\n <td><code>http.js</code></td>\n <td>93%</td>\n <td>25</td>\n </tr>\n <tr>\n <td><code>http-apps.js</code></td>\n <td>80%</td>\n <td>286</td>\n </tr>\n <tr>\n <td><code>http-cookie.js</code></td>\n <td>79%</td>\n <td>15</td>\n </tr>\n </tbody>\n</table>\n\n---\n\nCopyright 2009–2013 Kristopher Michael Kowal\nMIT License (enclosed)\n\n",
48
- "readmeFilename": "README.md",
49
- "_id": "q-io@1.10.9",
50
- "_from": "q-io@~1.10.6"
51
- }
@@ -1,133 +0,0 @@
1
-
2
- var Q = require("q");
3
-
4
- /**
5
- * Wraps a Node readable stream, providing an API similar
6
- * to a Narwhal synchronous `io` stream except returning
7
- * Q promises for long latency operations.
8
- * @param stream any Node readable stream
9
- * @returns {Promise * Reader} a promise for
10
- * the text stream reader.
11
- * @constructor
12
- */
13
- module.exports = Reader;
14
- function Reader(_stream, charset) {
15
- var self = Object.create(Reader.prototype);
16
-
17
- if (charset && _stream.setEncoding) // TODO complain about inconsistency
18
- _stream.setEncoding(charset);
19
-
20
- var begin = Q.defer();
21
- var end = Q.defer();
22
-
23
- _stream.on("error", function (reason) {
24
- begin.reject(reason);
25
- });
26
-
27
- var chunks = [];
28
- var receiver;
29
-
30
- _stream.on("end", function () {
31
- begin.resolve(self);
32
- end.resolve()
33
- });
34
-
35
- _stream.on("data", function (chunk) {
36
- begin.resolve(self);
37
- if (receiver) {
38
- receiver(chunk);
39
- } else {
40
- chunks.push(chunk);
41
- }
42
- });
43
-
44
- function slurp() {
45
- var result;
46
- if (charset) {
47
- result = chunks.join("");
48
- } else {
49
- result = self.constructor.join(chunks);
50
- }
51
- chunks.splice(0, chunks.length);
52
- return result;
53
- }
54
-
55
- /***
56
- * Reads all of the remaining data from the stream.
57
- * @returns {Promise * String} a promise for a String
58
- * containing the entirety the remaining stream.
59
- */
60
- self.read = function () {
61
- receiver = undefined;
62
- var deferred = Q.defer();
63
- Q.done(end.promise, function () {
64
- deferred.resolve(slurp());
65
- });
66
- return deferred.promise;
67
- };
68
-
69
- /***
70
- * Reads and writes all of the remaining data from the
71
- * stream in chunks.
72
- * @param {Function(Promise * String)} write a function
73
- * to be called on each chunk of input from this stream.
74
- * @returns {Promise * Undefined} a promise that will
75
- * be resolved when the input is depleted.
76
- */
77
- self.forEach = function (write) {
78
- if (chunks && chunks.length)
79
- write(slurp());
80
- receiver = write;
81
- return Q.when(end.promise, function () {
82
- receiver = undefined;
83
- });
84
- };
85
-
86
- self.close = function () {
87
- _stream.destroy();
88
- };
89
-
90
- self.node = _stream;
91
-
92
- return begin.promise;
93
- }
94
-
95
- /*
96
- Reads an entire forEachable stream of buffers and returns a single buffer.
97
- */
98
- Reader.read = read;
99
- function read(stream, charset) {
100
- var chunks = [];
101
- stream.forEach(function (chunk) {
102
- chunks.push(chunk);
103
- });
104
- if (charset) {
105
- return chunks.join("");
106
- } else {
107
- return join(chunks);
108
- }
109
- }
110
-
111
- Reader.join = join;
112
- function join(buffers) {
113
- var length = 0;
114
- var at;
115
- var i;
116
- var ii = buffers.length;
117
- var buffer;
118
- var result;
119
- for (i = 0; i < ii; i++) {
120
- buffer = buffers[i];
121
- length += buffer.length;
122
- }
123
- result = new Buffer(length);
124
- at = 0;
125
- for (i = 0; i < ii; i++) {
126
- buffer = buffers[i];
127
- buffer.copy(result, at, 0);
128
- at += buffer.length;
129
- }
130
- buffers.splice(0, ii, result);
131
- return result;
132
- }
133
-