traceur-rb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +4 -0
  7. data/Guardfile +8 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +87 -0
  10. data/Rakefile +2 -0
  11. data/lib/js/compile.js +31 -0
  12. data/lib/traceur-rb.rb +1 -0
  13. data/lib/traceur.rb +43 -0
  14. data/lib/traceur/compilation_options.rb +65 -0
  15. data/lib/traceur/compiler.rb +33 -0
  16. data/lib/traceur/configuration.rb +47 -0
  17. data/lib/traceur/node.rb +26 -0
  18. data/lib/traceur/node/command_result.rb +28 -0
  19. data/lib/traceur/node/runner.rb +40 -0
  20. data/lib/traceur/version.rb +3 -0
  21. data/spec/examples/classes.js +12 -0
  22. data/spec/integration/examples_spec.rb +28 -0
  23. data/spec/spec_helper.rb +1 -0
  24. data/spec/traceur/compilation_options_spec.rb +31 -0
  25. data/spec/traceur/configuration_spec.rb +54 -0
  26. data/spec/traceur/node_spec.rb +15 -0
  27. data/traceur-rb.gemspec +25 -0
  28. data/vendor/node_modules/.bin/traceur +3 -0
  29. data/vendor/node_modules/traceur/README.md +40 -0
  30. data/vendor/node_modules/traceur/bin/traceur-runtime.js +2101 -0
  31. data/vendor/node_modules/traceur/bin/traceur.js +23034 -0
  32. data/vendor/node_modules/traceur/node_modules/.bin/semver +125 -0
  33. data/vendor/node_modules/traceur/node_modules/commander/Readme.md +208 -0
  34. data/vendor/node_modules/traceur/node_modules/commander/index.js +852 -0
  35. data/vendor/node_modules/traceur/node_modules/commander/package.json +40 -0
  36. data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +1 -0
  37. data/vendor/node_modules/traceur/node_modules/q-io/.travis.yml +3 -0
  38. data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +122 -0
  39. data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +19 -0
  40. data/vendor/node_modules/traceur/node_modules/q-io/README.md +928 -0
  41. data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +59 -0
  42. data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +44 -0
  43. data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +51 -0
  44. data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +307 -0
  45. data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +499 -0
  46. data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +547 -0
  47. data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +105 -0
  48. data/vendor/node_modules/traceur/node_modules/q-io/fs.js +355 -0
  49. data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +65 -0
  50. data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +152 -0
  51. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +24 -0
  52. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +93 -0
  53. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +154 -0
  54. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +178 -0
  55. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +417 -0
  56. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +58 -0
  57. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +78 -0
  58. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +120 -0
  59. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +27 -0
  60. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +209 -0
  61. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +125 -0
  62. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +175 -0
  63. data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +75 -0
  64. data/vendor/node_modules/traceur/node_modules/q-io/http.js +378 -0
  65. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +11 -0
  66. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.travis.yml +4 -0
  67. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +78 -0
  68. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +21 -0
  69. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +1285 -0
  70. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +22 -0
  71. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +142 -0
  72. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +57 -0
  73. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +183 -0
  74. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +261 -0
  75. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +186 -0
  76. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +55 -0
  77. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +59 -0
  78. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +236 -0
  79. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +371 -0
  80. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +435 -0
  81. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +247 -0
  82. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +147 -0
  83. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +448 -0
  84. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +139 -0
  85. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +79 -0
  86. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +142 -0
  87. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +60 -0
  88. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +41 -0
  89. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +12 -0
  90. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +7 -0
  91. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +48 -0
  92. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +590 -0
  93. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +49 -0
  94. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +173 -0
  95. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +274 -0
  96. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +59 -0
  97. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +538 -0
  98. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +14 -0
  99. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +6 -0
  100. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +49 -0
  101. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +51 -0
  102. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +269 -0
  103. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +61 -0
  104. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +736 -0
  105. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +40 -0
  106. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +1 -0
  107. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/LICENSE +19 -0
  108. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +66 -0
  109. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +114 -0
  110. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +35 -0
  111. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +84 -0
  112. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +1588 -0
  113. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +77 -0
  114. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +15 -0
  115. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +19 -0
  116. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +96 -0
  117. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +166 -0
  118. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +43 -0
  119. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +40 -0
  120. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +19 -0
  121. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +813 -0
  122. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +71 -0
  123. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +36 -0
  124. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +93 -0
  125. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +1937 -0
  126. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +35 -0
  127. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +6 -0
  128. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +36 -0
  129. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +7 -0
  130. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +38 -0
  131. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +32 -0
  132. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +39 -0
  133. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +2 -0
  134. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +123 -0
  135. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +19 -0
  136. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +3 -0
  137. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +3 -0
  138. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +128 -0
  139. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +53 -0
  140. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +61 -0
  141. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +856 -0
  142. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +1080 -0
  143. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +377 -0
  144. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +290 -0
  145. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
  146. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
  147. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +4 -0
  148. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +16 -0
  149. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +12 -0
  150. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +91 -0
  151. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +12 -0
  152. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +13 -0
  153. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +14 -0
  154. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +146 -0
  155. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
  156. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
  157. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +3 -0
  158. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +22 -0
  159. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +6 -0
  160. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +248 -0
  161. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +53 -0
  162. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +2 -0
  163. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +91 -0
  164. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +548 -0
  165. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +8 -0
  166. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +358 -0
  167. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +133 -0
  168. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +3 -0
  169. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.travis.yml +4 -0
  170. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +20 -0
  171. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +33 -0
  172. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +37 -0
  173. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +125 -0
  174. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +151 -0
  175. data/vendor/node_modules/traceur/node_modules/q-io/package.json +51 -0
  176. data/vendor/node_modules/traceur/node_modules/q-io/reader.js +133 -0
  177. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +47 -0
  178. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +11 -0
  179. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +1 -0
  180. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +33 -0
  181. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +92 -0
  182. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +41 -0
  183. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +57 -0
  184. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +1 -0
  185. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +70 -0
  186. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +109 -0
  187. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +67 -0
  188. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +219 -0
  189. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +20 -0
  190. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +26 -0
  191. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +40 -0
  192. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +37 -0
  193. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +39 -0
  194. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +32 -0
  195. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +26 -0
  196. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +86 -0
  197. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +31 -0
  198. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +73 -0
  199. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +23 -0
  200. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +1 -0
  201. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +22 -0
  202. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +25 -0
  203. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +45 -0
  204. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +38 -0
  205. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +52 -0
  206. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +86 -0
  207. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +1 -0
  208. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +1 -0
  209. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
  210. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
  211. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +49 -0
  212. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +47 -0
  213. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +186 -0
  214. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +82 -0
  215. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +110 -0
  216. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +96 -0
  217. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +96 -0
  218. data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +42 -0
  219. data/vendor/node_modules/traceur/node_modules/q-io/writer.js +111 -0
  220. data/vendor/node_modules/traceur/node_modules/semver/.npmignore +1 -0
  221. data/vendor/node_modules/traceur/node_modules/semver/LICENSE +27 -0
  222. data/vendor/node_modules/traceur/node_modules/semver/Makefile +24 -0
  223. data/vendor/node_modules/traceur/node_modules/semver/README.md +158 -0
  224. data/vendor/node_modules/traceur/node_modules/semver/bin/semver +125 -0
  225. data/vendor/node_modules/traceur/node_modules/semver/foot.js +6 -0
  226. data/vendor/node_modules/traceur/node_modules/semver/head.js +2 -0
  227. data/vendor/node_modules/traceur/node_modules/semver/package.json +31 -0
  228. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +1039 -0
  229. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
  230. data/vendor/node_modules/traceur/node_modules/semver/semver.js +1043 -0
  231. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -0
  232. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
  233. data/vendor/node_modules/traceur/node_modules/semver/test/amd.js +15 -0
  234. data/vendor/node_modules/traceur/node_modules/semver/test/gtr.js +173 -0
  235. data/vendor/node_modules/traceur/node_modules/semver/test/index.js +584 -0
  236. data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +174 -0
  237. data/vendor/node_modules/traceur/node_modules/semver/test/no-module.js +19 -0
  238. data/vendor/node_modules/traceur/package.json +64 -0
  239. data/vendor/node_modules/traceur/src/node/System.js +31 -0
  240. data/vendor/node_modules/traceur/src/node/api.js +124 -0
  241. data/vendor/node_modules/traceur/src/node/command.js +141 -0
  242. data/vendor/node_modules/traceur/src/node/compile-single-file.js +69 -0
  243. data/vendor/node_modules/traceur/src/node/compiler.js +116 -0
  244. data/vendor/node_modules/traceur/src/node/deferred.js +110 -0
  245. data/vendor/node_modules/traceur/src/node/file-util.js +73 -0
  246. data/vendor/node_modules/traceur/src/node/getopt.js +147 -0
  247. data/vendor/node_modules/traceur/src/node/inline-module.js +149 -0
  248. data/vendor/node_modules/traceur/src/node/interpreter.js +33 -0
  249. data/vendor/node_modules/traceur/src/node/nodeLoader.js +41 -0
  250. data/vendor/node_modules/traceur/src/node/require.js +85 -0
  251. data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +33 -0
  252. data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +33 -0
  253. data/vendor/node_modules/traceur/src/node/traceur.js +32 -0
  254. data/vendor/node_modules/traceur/traceur +3 -0
  255. metadata +359 -0
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ require("../../lib/jasmine-promise");
4
+ var Q = require("q");
5
+ var FS = require("../../../fs");
6
+ var Mock = require("../../../fs-mock");
7
+ var Root = require("../../../fs-root");
8
+
9
+ describe("root", function () {
10
+ it("should make a filesystem from a subtree of a mock filesystem", function () {
11
+
12
+ var mock = Mock({
13
+ "a/b/1": 10,
14
+ "a/b/2": 20,
15
+ "a/b/3": 30
16
+ });
17
+
18
+ var chroot = Root(mock, "a/b");
19
+
20
+ return chroot.invoke("listTree")
21
+ .then(function (list) {
22
+ expect(list).toEqual([
23
+ ".",
24
+ "1",
25
+ "2",
26
+ "3"
27
+ ]);
28
+ });
29
+
30
+ });
31
+ });
32
+
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ require("../../lib/jasmine-promise");
4
+ var Q = require("q");
5
+ var FS = require("../../../fs");
6
+ /*global describe,it,expect */
7
+
8
+ describe("stat", function () {
9
+ it("should return a Stats object", function () {
10
+ return FS.mock(FS.join(__dirname, "fixture"))
11
+ .then(function (mock) {
12
+ return mock.stat("hello.txt");
13
+ })
14
+ .then(function (stat) {
15
+ expect(stat.node).toBeDefined();
16
+ expect(stat.size).toBeDefined();
17
+ expect(stat.size).toBeGreaterThan(0);
18
+ expect(stat.isDirectory()).toBe(false);
19
+ expect(stat.isFile()).toBe(true);
20
+ });
21
+ });
22
+
23
+
24
+
25
+ });
26
+
@@ -0,0 +1,86 @@
1
+
2
+ require("../../lib/jasmine-promise");
3
+ var MockFs = require("../../../fs-mock");
4
+ var normalize = require('../../../fs').normal;
5
+
6
+ describe("symbolic link", function () {
7
+ it("should", function () {
8
+ var mock = MockFs();
9
+
10
+ // make some content
11
+ return mock.makeTree("a/b")
12
+ .then(function () {
13
+ return mock.write("a/b/c.txt", "Hello, World!")
14
+ })
15
+
16
+ // verify content
17
+ .then(function () {
18
+ return mock.read("a/b/c.txt")
19
+ })
20
+ .then(function (content) {
21
+ expect(content).toBe("Hello, World!");
22
+ })
23
+
24
+ // link it
25
+ .then(function () {
26
+ return mock.symbolicCopy("/a/b/c.txt", "a/b/d.txt", "file")
27
+ })
28
+
29
+ // should have a link
30
+ .then(function () {
31
+ return mock.readLink("a/b/d.txt")
32
+ })
33
+ .then(function (link) {
34
+ expect(link).toBe("c.txt");
35
+ })
36
+
37
+ // should have a canonical path
38
+ .then(function () {
39
+ return mock.canonical("a/b/d.txt")
40
+ })
41
+ .then(function (canonical) {
42
+ expect(canonical).toBe("/a/b/c.txt");
43
+ })
44
+
45
+ // should be listed
46
+ .then(function () {
47
+ return mock.listTree()
48
+ })
49
+ .then(function (content) {
50
+ expect(content).toEqual([
51
+ ".",
52
+ "a",
53
+ normalize("a/b"),
54
+ normalize("a/b/c.txt"),
55
+ normalize("a/b/d.txt")
56
+ ])
57
+ })
58
+
59
+ // should be non-destructive
60
+ .then(function () {
61
+ return mock.read("a/b/c.txt")
62
+ })
63
+ .then(function (content) {
64
+ expect(content).toBe("Hello, World!");
65
+ })
66
+
67
+ // should be identified as a file
68
+ .then(function () {
69
+ return mock.isSymbolicLink("a/b/d.txt");
70
+ })
71
+ .then(function (isSymbolicLink) {
72
+ expect(isSymbolicLink).toBe(true);
73
+ })
74
+
75
+ // should have the same content
76
+ .then(function () {
77
+ return mock.read("a/b/d.txt");
78
+ })
79
+ .then(function (content) {
80
+ expect(content).toBe("Hello, World!");
81
+ });
82
+
83
+ });
84
+ });
85
+
86
+
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ require("../../lib/jasmine-promise");
4
+ var Q = require("q");
5
+ var Mock = require("../../../fs-mock");
6
+
7
+ describe("mock working directory", function () {
8
+ it("should perform actions relative to the given working directory", function () {
9
+
10
+ var mock = Mock({
11
+ "a/b": {
12
+ "c": {
13
+ "d": 66,
14
+ "e": 99
15
+ }
16
+ }
17
+ }, "a/b/c");
18
+
19
+ return mock.listTree()
20
+ .then(function (list) {
21
+ expect(list).toEqual([
22
+ ".",
23
+ "d",
24
+ "e"
25
+ ]);
26
+ })
27
+
28
+ });
29
+
30
+ });
31
+
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ require("../../lib/jasmine-promise");
4
+ var Q = require("q");
5
+ var FS = require("../../../fs");
6
+ /*global describe,it,expect */
7
+
8
+ describe("write", function () {
9
+ it("should write a file to a mock filesystem", function () {
10
+ return FS.mock(FS.join(__dirname, "fixture"))
11
+ .then(function (mock) {
12
+
13
+ return Q.fcall(function () {
14
+ return mock.write("hello.txt", "Goodbye!\n");
15
+ })
16
+ .then(function () {
17
+ return mock.isFile("hello.txt");
18
+ })
19
+ .then(function (isFile) {
20
+ expect(isFile).toBe(true);
21
+ return mock.read("hello.txt");
22
+ })
23
+ .then(function (content) {
24
+ expect(content.toString("utf-8")).toBe("Goodbye!\n");
25
+ })
26
+ });
27
+ });
28
+
29
+ it("takes a flags argument", function () {
30
+ return FS.mock(FS.join(__dirname, "fixture"))
31
+ .then(function (mock) {
32
+ return Q.fcall(function () {
33
+ return mock.write("hello.txt", "Goodbye!\n", "a");
34
+ })
35
+ .then(function () {
36
+ return mock.read("hello.txt");
37
+ })
38
+ .then(function (contents) {
39
+ expect(contents).toBe("Hello, World!\nGoodbye!\n");
40
+ });
41
+ });
42
+ });
43
+
44
+ it("takes an options object with flags", function () {
45
+ return FS.mock(FS.join(__dirname, "fixture"))
46
+ .then(function (mock) {
47
+ return Q.fcall(function () {
48
+ return mock.write("hello.txt", "Goodbye!\n", { flags: "a" });
49
+ })
50
+ .then(function () {
51
+ return mock.read("hello.txt");
52
+ })
53
+ .then(function (contents) {
54
+ expect(contents).toBe("Hello, World!\nGoodbye!\n");
55
+ });
56
+ });
57
+ });
58
+
59
+ it("calls open correctly", function () {
60
+ return FS.mock(FS.join(__dirname, "fixture"))
61
+ .then(function (mock) {
62
+ mock.open = function (path, options) {
63
+ expect(path).toBe("hello.txt");
64
+ expect(options.flags).toBe("a");
65
+ expect(options.charset).toBe("utf8");
66
+ return Q.resolve({write: function () {}, close: function () {}});
67
+ };
68
+
69
+ return mock.write("hello.txt", "Goodbye!\n", "a", "utf8");
70
+ });
71
+ });
72
+ });
73
+
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ require("../lib/jasmine-promise");
4
+ var Q = require("q");
5
+ var FS = require("../../fs");
6
+
7
+ describe("open range", function () {
8
+ it("read a partial range of a file", function () {
9
+
10
+ var name = FS.join(module.directory || __dirname, "range-spec.txt");
11
+
12
+ return FS.open(name, {
13
+ begin: 1,
14
+ end: 3
15
+ })
16
+ .invoke("read")
17
+ .then(function (content) {
18
+ expect(content).toBe("23");
19
+ })
20
+
21
+ });
22
+ });
23
+
@@ -0,0 +1,22 @@
1
+
2
+ require("../lib/jasmine-promise");
3
+ var FS = require("../../fs");
4
+
5
+ describe("read", function () {
6
+
7
+ it("should read in utf-8", function () {
8
+ return FS.read(FS.join(__dirname, "fixtures/hello.txt"))
9
+ .then(function (text) {
10
+ expect(text).toBe("Hello, World!\n");
11
+ });
12
+ });
13
+
14
+ it("should read in bytewise", function () {
15
+ return FS.read(FS.join(__dirname, "fixtures/hello.txt"), "b")
16
+ .then(function (bytes) {
17
+ expect(bytes instanceof Buffer).toBe(true);
18
+ });
19
+ });
20
+
21
+ });
22
+
@@ -0,0 +1,25 @@
1
+
2
+ var FS = require("../../fs");
3
+
4
+ describe("relativeFromDirectory", function () {
5
+
6
+ it("should find the relative path from a directory", function () {
7
+
8
+ expect(FS.relativeFromDirectory("/a/b", "/a/b")).toBe("");
9
+ expect(FS.relativeFromDirectory("/a/b/", "/a/b")).toBe("");
10
+ expect(FS.relativeFromDirectory("/a/b", "/a/b/")).toBe("");
11
+ expect(FS.relativeFromDirectory("/a/b/", "/a/b/")).toBe("");
12
+
13
+ expect(FS.relativeFromDirectory("/a/b", "/a/b/c")).toBe("c");
14
+ expect(FS.relativeFromDirectory("/a/b/", "/a/b/c")).toBe("c");
15
+ expect(FS.relativeFromDirectory("/a/b", "/a/b/c/")).toBe("c");
16
+ expect(FS.relativeFromDirectory("/a/b/", "/a/b/c/")).toBe("c");
17
+
18
+ expect(FS.relativeFromDirectory("/a/b", "/a")).toBe("..");
19
+ expect(FS.relativeFromDirectory("/a/b/", "/a")).toBe("..");
20
+ expect(FS.relativeFromDirectory("/a/b", "/a/")).toBe("..");
21
+ expect(FS.relativeFromDirectory("/a/b/", "/a/")).toBe("..");
22
+
23
+ });
24
+
25
+ });
@@ -0,0 +1,45 @@
1
+ var FS = require("../../fs");
2
+
3
+ require("../lib/jasmine-promise");
4
+
5
+ describe("reroot", function () {
6
+
7
+ it("should still have makeDirectory()", function() {
8
+ return FS.reroot("/")
9
+ .then(function(fs) {
10
+ expect(fs.makeTree instanceof Function).toBe(true);
11
+ expect(fs.makeDirectory instanceof Function).toBe(true);
12
+ });
13
+ });
14
+
15
+ it("should have a makeDirectory() that creates within the attenuated root", function() {
16
+ var tmpdir = FS.join(__dirname, 'tmp');
17
+ return FS.removeTree(tmpdir)
18
+ .then(null, function () {
19
+ // ignore fail
20
+ }).then(function() {
21
+ return FS.makeTree(tmpdir)
22
+ }).then(function () {
23
+ return FS.isDirectory(tmpdir);
24
+ }).then(function (isDirectory) {
25
+ if (!isDirectory)
26
+ throw new Error("Failed to create tmpdir");
27
+ }).then(function() {
28
+ return FS.reroot(tmpdir);
29
+ }).then(function(fs) {
30
+ return fs.makeDirectory('/foo');
31
+ }).then(function() {
32
+ var outerFooDir = FS.join(tmpdir, 'foo');
33
+ return FS.isDirectory(outerFooDir);
34
+ }).then(function(isDirectory) {
35
+ if (!isDirectory)
36
+ throw new Error("Directory not created");
37
+ })
38
+ .finally(function () {
39
+ return FS.removeTree(tmpdir)
40
+ .then(null, function () {
41
+ // ignore fail
42
+ })
43
+ })
44
+ });
45
+ });
@@ -0,0 +1,38 @@
1
+
2
+ require("../lib/jasmine-promise");
3
+ var FS = require("../../fs");
4
+
5
+ describe("write", function () {
6
+ it("should write in utf-8", function () {
7
+ var path = FS.join(__dirname, "fixtures/so-it-is-written.txt");
8
+ var content = "Hello, World!\n";
9
+ return FS.write(path, content)
10
+ .then(function (result) {
11
+ expect(result).toBe(undefined);
12
+ return FS.read(path)
13
+ })
14
+ .then(function (readContent) {
15
+ expect(readContent).toEqual(content);
16
+ })
17
+ .finally(function () {
18
+ return FS.remove(path);
19
+ });
20
+ });
21
+
22
+ it("should write bytewise", function () {
23
+ var path = FS.join(__dirname, "fixtures/so-it-is-written.txt");
24
+ var content = "Good bye, cruel World!\n";
25
+ return FS.write(path, new Buffer(content, "utf-8"))
26
+ .then(function (result) {
27
+ expect(result).toBe(undefined);
28
+ return FS.read(path)
29
+ })
30
+ .then(function (readContent) {
31
+ expect(readContent).toEqual(content);
32
+ })
33
+ .finally(function () {
34
+ return FS.remove(path);
35
+ });
36
+ });
37
+ });
38
+
@@ -0,0 +1,52 @@
1
+
2
+ require("../lib/jasmine-promise");
3
+ var Q = require("q");
4
+ var Http = require("../../http");
5
+ var Apps = require("../../http-apps");
6
+
7
+ describe("http cookies", function () {
8
+
9
+ var hosts = ["localhost", "127.0.0.1"];
10
+
11
+ hosts.forEach(function (host) {
12
+ it("should work on host" + host, function () {
13
+
14
+ var server = Http.Server(function (request) {
15
+ return {
16
+ status: 200,
17
+ headers: {
18
+ "set-cookie": "a=10; MaxAge=1"
19
+ },
20
+ body: [request.headers.cookie || ""]
21
+ };
22
+ });
23
+
24
+ var request = Apps.Normalize(Apps.CookieJar(Http.request));
25
+
26
+ return server.listen(0)
27
+ .then(function (server) {
28
+ var address = server.node.address();
29
+ return request("http://" + host + ":" + address.port)
30
+ .get("body")
31
+ .invoke("read")
32
+ .invoke("toString", "utf-8")
33
+ .then(function (content) {
34
+ expect(content).toEqual(""); // no cookie first time
35
+ })
36
+ .then(function () {
37
+ return request("http://" + host + ":" + address.port)
38
+ .get("body")
39
+ .invoke("read")
40
+ .invoke("toString", "utf-8")
41
+ })
42
+ .then(function (content) {
43
+ expect(content).toEqual("a=10"); // cookie set second time
44
+ })
45
+ })
46
+ .timeout(1000)
47
+ .finally(server.stop)
48
+ });
49
+ });
50
+
51
+ });
52
+