traceur-rb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +22 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +87 -0
- data/Rakefile +2 -0
- data/lib/js/compile.js +31 -0
- data/lib/traceur-rb.rb +1 -0
- data/lib/traceur.rb +43 -0
- data/lib/traceur/compilation_options.rb +65 -0
- data/lib/traceur/compiler.rb +33 -0
- data/lib/traceur/configuration.rb +47 -0
- data/lib/traceur/node.rb +26 -0
- data/lib/traceur/node/command_result.rb +28 -0
- data/lib/traceur/node/runner.rb +40 -0
- data/lib/traceur/version.rb +3 -0
- data/spec/examples/classes.js +12 -0
- data/spec/integration/examples_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/traceur/compilation_options_spec.rb +31 -0
- data/spec/traceur/configuration_spec.rb +54 -0
- data/spec/traceur/node_spec.rb +15 -0
- data/traceur-rb.gemspec +25 -0
- data/vendor/node_modules/.bin/traceur +3 -0
- data/vendor/node_modules/traceur/README.md +40 -0
- data/vendor/node_modules/traceur/bin/traceur-runtime.js +2101 -0
- data/vendor/node_modules/traceur/bin/traceur.js +23034 -0
- data/vendor/node_modules/traceur/node_modules/.bin/semver +125 -0
- data/vendor/node_modules/traceur/node_modules/commander/Readme.md +208 -0
- data/vendor/node_modules/traceur/node_modules/commander/index.js +852 -0
- data/vendor/node_modules/traceur/node_modules/commander/package.json +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/.travis.yml +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +122 -0
- data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/README.md +928 -0
- data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +44 -0
- data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +307 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +499 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +547 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +105 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs.js +355 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +65 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +152 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +24 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +93 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +154 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +178 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +417 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +58 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +78 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +120 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +27 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +209 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +125 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +175 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +75 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http.js +378 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +11 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +78 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +21 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +1285 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +142 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +57 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +183 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +261 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +186 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +55 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +236 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +371 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +435 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +247 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +147 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +448 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +139 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +79 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +142 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +60 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +41 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +7 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +48 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +590 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +173 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +274 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +538 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +14 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +269 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +61 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +736 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +66 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +114 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +35 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +84 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +1588 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +77 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +15 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +166 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +43 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +813 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +71 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +36 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +93 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +1937 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +35 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +36 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +7 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +38 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +32 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +2 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +123 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +128 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +53 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +61 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +856 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +1080 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +377 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +290 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +16 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +91 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +13 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +14 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +146 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +248 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +53 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +2 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +91 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +548 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +8 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +358 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +133 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +20 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +33 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +37 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +125 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +151 -0
- data/vendor/node_modules/traceur/node_modules/q-io/package.json +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/reader.js +133 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +47 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +11 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +33 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +92 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +41 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +57 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +70 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +109 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +67 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +219 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +20 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +26 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +37 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +32 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +26 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +86 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +31 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +73 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +23 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +25 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +45 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +38 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +52 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +86 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +47 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +186 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +82 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +110 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +42 -0
- data/vendor/node_modules/traceur/node_modules/q-io/writer.js +111 -0
- data/vendor/node_modules/traceur/node_modules/semver/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/LICENSE +27 -0
- data/vendor/node_modules/traceur/node_modules/semver/Makefile +24 -0
- data/vendor/node_modules/traceur/node_modules/semver/README.md +158 -0
- data/vendor/node_modules/traceur/node_modules/semver/bin/semver +125 -0
- data/vendor/node_modules/traceur/node_modules/semver/foot.js +6 -0
- data/vendor/node_modules/traceur/node_modules/semver/head.js +2 -0
- data/vendor/node_modules/traceur/node_modules/semver/package.json +31 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +1039 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.js +1043 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/amd.js +15 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/gtr.js +173 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/index.js +584 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +174 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/no-module.js +19 -0
- data/vendor/node_modules/traceur/package.json +64 -0
- data/vendor/node_modules/traceur/src/node/System.js +31 -0
- data/vendor/node_modules/traceur/src/node/api.js +124 -0
- data/vendor/node_modules/traceur/src/node/command.js +141 -0
- data/vendor/node_modules/traceur/src/node/compile-single-file.js +69 -0
- data/vendor/node_modules/traceur/src/node/compiler.js +116 -0
- data/vendor/node_modules/traceur/src/node/deferred.js +110 -0
- data/vendor/node_modules/traceur/src/node/file-util.js +73 -0
- data/vendor/node_modules/traceur/src/node/getopt.js +147 -0
- data/vendor/node_modules/traceur/src/node/inline-module.js +149 -0
- data/vendor/node_modules/traceur/src/node/interpreter.js +33 -0
- data/vendor/node_modules/traceur/src/node/nodeLoader.js +41 -0
- data/vendor/node_modules/traceur/src/node/require.js +85 -0
- data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +33 -0
- data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +33 -0
- data/vendor/node_modules/traceur/src/node/traceur.js +32 -0
- data/vendor/node_modules/traceur/traceur +3 -0
- metadata +359 -0
@@ -0,0 +1,86 @@
|
|
1
|
+
|
2
|
+
require("../lib/jasmine-promise");
|
3
|
+
var Http = require("../../http");
|
4
|
+
var Apps = require("../../http-apps");
|
5
|
+
var FS = require("../../fs");
|
6
|
+
|
7
|
+
describe("directory lists", function () {
|
8
|
+
|
9
|
+
it("should be fine in plain text", function () {
|
10
|
+
|
11
|
+
var fixture = FS.join(module.directory || __dirname, "fixtures");
|
12
|
+
|
13
|
+
var app = new Apps.Chain()
|
14
|
+
.use(Apps.Cap)
|
15
|
+
.use(Apps.ListDirectories)
|
16
|
+
.use(function () {
|
17
|
+
return Apps.FileTree(fixture);
|
18
|
+
})
|
19
|
+
.end()
|
20
|
+
|
21
|
+
return Http.Server(app)
|
22
|
+
.listen(0)
|
23
|
+
.then(function (server) {
|
24
|
+
var port = server.address().port;
|
25
|
+
return Http.read({
|
26
|
+
url: "http://127.0.0.1:" + port + "/",
|
27
|
+
headers: {
|
28
|
+
accept: "text/plain"
|
29
|
+
},
|
30
|
+
charset: 'utf-8'
|
31
|
+
})
|
32
|
+
.then(function (content) {
|
33
|
+
expect(content).toEqual("01234.txt\n1234.txt\n5678.txt\n9012/\n");
|
34
|
+
})
|
35
|
+
.finally(server.stop);
|
36
|
+
});
|
37
|
+
|
38
|
+
});
|
39
|
+
|
40
|
+
it("should be fine in html", function () {
|
41
|
+
|
42
|
+
var fixture = FS.join(module.directory || __dirname, "fixtures");
|
43
|
+
|
44
|
+
var app = new Apps.Chain()
|
45
|
+
.use(Apps.Cap)
|
46
|
+
.use(Apps.HandleHtmlFragmentResponses)
|
47
|
+
.use(Apps.ListDirectories)
|
48
|
+
.use(function () {
|
49
|
+
return Apps.FileTree(fixture);
|
50
|
+
})
|
51
|
+
.end()
|
52
|
+
|
53
|
+
return Http.Server(app)
|
54
|
+
.listen(0)
|
55
|
+
.then(function (server) {
|
56
|
+
var port = server.address().port;
|
57
|
+
return Http.read({
|
58
|
+
url: "http://127.0.0.1:" + port + "/",
|
59
|
+
headers: {
|
60
|
+
accept: "text/html"
|
61
|
+
},
|
62
|
+
charset: 'utf-8'
|
63
|
+
})
|
64
|
+
.then(function (content) {
|
65
|
+
expect(content).toEqual(
|
66
|
+
"<!doctype html>\n" +
|
67
|
+
"<html>\n" +
|
68
|
+
" <head>\n" +
|
69
|
+
" <title>Directory Index</title>\n" +
|
70
|
+
" </head>\n" +
|
71
|
+
" <body>\n" +
|
72
|
+
" <ul class=\"directory-index\">\n" +
|
73
|
+
" <li class=\"entry file\"><a href=\"01234.txt\">01234.txt</a></li>\n" +
|
74
|
+
" <li class=\"entry file\"><a href=\"1234.txt\">1234.txt</a></li>\n" +
|
75
|
+
" <li class=\"entry file\"><a href=\"5678.txt\">5678.txt</a></li>\n" +
|
76
|
+
" <li class=\"entry directory\"><a href=\"9012/\">9012/</a></li>\n" +
|
77
|
+
" </ul>\n" +
|
78
|
+
" </body>\n" +
|
79
|
+
"</html>\n"
|
80
|
+
);
|
81
|
+
})
|
82
|
+
.finally(server.stop);
|
83
|
+
});
|
84
|
+
|
85
|
+
});
|
86
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
01234.txt
|
@@ -0,0 +1 @@
|
|
1
|
+
1234
|
File without changes
|
File without changes
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
require("../lib/jasmine-promise");
|
3
|
+
var Q = require("q");
|
4
|
+
var Http = require("../../http");
|
5
|
+
var Negotiate = require("../../http-apps/negotiate");
|
6
|
+
var Content = require("../../http-apps/content");
|
7
|
+
|
8
|
+
describe("http host negotiation", function () {
|
9
|
+
it("should work", function () {
|
10
|
+
return Http.Server(Negotiate.Host({
|
11
|
+
"localhost:999": function (request) {
|
12
|
+
throw new Error("Should not get here");
|
13
|
+
},
|
14
|
+
"127.0.0.1:999": function (request) {
|
15
|
+
throw new Error("Should not get here");
|
16
|
+
},
|
17
|
+
"localhost": function (request) {
|
18
|
+
return Content.ok("Hello, Localhost");
|
19
|
+
},
|
20
|
+
"127.0.0.1": function (request) {
|
21
|
+
return Content.ok("Hello, 127.0.0.1");
|
22
|
+
}
|
23
|
+
}))
|
24
|
+
.listen(0)
|
25
|
+
.then(function (server) {
|
26
|
+
var port = server.address().port;
|
27
|
+
return Q.fcall(function () {
|
28
|
+
return Http.read({
|
29
|
+
"url": "http://localhost:" + port,
|
30
|
+
"charset": "utf-8"
|
31
|
+
})
|
32
|
+
.then(function (result) {
|
33
|
+
expect(result).toEqual("Hello, Localhost");
|
34
|
+
});
|
35
|
+
})
|
36
|
+
.then(function () {
|
37
|
+
return Http.read({
|
38
|
+
"url": "http://127.0.0.1:" + port,
|
39
|
+
"charset": "utf-8"
|
40
|
+
})
|
41
|
+
.then(function (result) {
|
42
|
+
expect(result).toEqual("Hello, 127.0.0.1");
|
43
|
+
});
|
44
|
+
})
|
45
|
+
.finally(server.stop);
|
46
|
+
});
|
47
|
+
});
|
48
|
+
});
|
49
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
// http://labs.apache.org/webarch/http/draft-fielding-http/p5-range.html#range.units
|
3
|
+
|
4
|
+
var Apps = require("../../http-apps/fs");
|
5
|
+
|
6
|
+
var size = 10000;
|
7
|
+
var tests = [
|
8
|
+
{
|
9
|
+
description: "The first 500 bytes (byte offsets 0-499, inclusive)",
|
10
|
+
input: "bytes=0-499",
|
11
|
+
oracle: {begin: 0, end: 500}
|
12
|
+
},
|
13
|
+
{
|
14
|
+
description: "The second 500 bytes (byte offsets 500-999, inclusive)",
|
15
|
+
input: "bytes=500-999",
|
16
|
+
oracle: {begin: 500, end: 1000}
|
17
|
+
},
|
18
|
+
{
|
19
|
+
description: "The initial 500 bytes with 0 elided",
|
20
|
+
input: "bytes=-499",
|
21
|
+
oracle: {begin: 0, end: 500}
|
22
|
+
},
|
23
|
+
{
|
24
|
+
description: "The final 500 bytes with final elided (byte offsets 9500-9999, inclusive)",
|
25
|
+
input: "bytes=9500-",
|
26
|
+
oracle: {begin: 9500, end: 10000}
|
27
|
+
},
|
28
|
+
{
|
29
|
+
description: "Legal but not canonical specification of the second 500 bytes (byte offsets 500-999, inclusive)",
|
30
|
+
input: "bytes=500-600,601-999",
|
31
|
+
oracle: {begin: 500, end: 1000}
|
32
|
+
},
|
33
|
+
{
|
34
|
+
description: "Legal but not canonical specification of the second 500 bytes (byte offsets 500-999, inclusive)",
|
35
|
+
input: "bytes=500-700,601-999",
|
36
|
+
oracle: {begin: 500, end: 1000}
|
37
|
+
}
|
38
|
+
];
|
39
|
+
|
40
|
+
describe("range interpretation", function () {
|
41
|
+
tests.forEach(function (test) {
|
42
|
+
it("should interpret " + test.input, function () {
|
43
|
+
expect(Apps.interpretFirstRange(test.input, size)).toEqual(test.oracle);
|
44
|
+
});
|
45
|
+
});
|
46
|
+
});
|
47
|
+
|
@@ -0,0 +1,186 @@
|
|
1
|
+
|
2
|
+
require("../lib/jasmine-promise");
|
3
|
+
var Http = require("../../http");
|
4
|
+
var Apps = require("../../http-apps");
|
5
|
+
var FS = require("../../fs");
|
6
|
+
|
7
|
+
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1
|
8
|
+
describe("HTTP Range", function () {
|
9
|
+
var fixture, app, serveAndTest;
|
10
|
+
describe("Byte Ranges" , function () {
|
11
|
+
beforeEach(function () {
|
12
|
+
fixture = FS.join(module.directory || __dirname, "fixtures", "01234.txt");
|
13
|
+
app = new Apps.Chain()
|
14
|
+
.use(Apps.Cap)
|
15
|
+
.use(function () {
|
16
|
+
return Apps.File(fixture);
|
17
|
+
})
|
18
|
+
.end();
|
19
|
+
serveAndTest = function serveAndTest(rangeExp, expectedStatus) {
|
20
|
+
return Http.Server(app)
|
21
|
+
.listen(0)
|
22
|
+
.then(function (server) {
|
23
|
+
var port = server.node.address().port;
|
24
|
+
return Http.read({
|
25
|
+
"url": "http://127.0.0.1:" + port + "/",
|
26
|
+
"headers": {
|
27
|
+
"range": rangeExp
|
28
|
+
}
|
29
|
+
}, function (response) {
|
30
|
+
return response.status === expectedStatus;
|
31
|
+
}).finally(server.stop);
|
32
|
+
})
|
33
|
+
}
|
34
|
+
});
|
35
|
+
|
36
|
+
// A byte range operation MAY specify a single range of bytes, or a set of ranges within a single entity.
|
37
|
+
// ranges-specifier = byte-ranges-specifier
|
38
|
+
// byte-ranges-specifier = bytes-unit "=" byte-range-set
|
39
|
+
// byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec )
|
40
|
+
// byte-range-spec = first-byte-pos "-" [last-byte-pos]
|
41
|
+
// first-byte-pos = 1*DIGIT
|
42
|
+
// last-byte-pos = 1*DIGIT
|
43
|
+
describe("byte range spec", function () {
|
44
|
+
// The first-byte-pos value in a byte-range-spec gives the byte-offset of the first byte in a range. The
|
45
|
+
// last-byte-pos value gives the byte-offset of the last byte in the range; that is, the byte positions
|
46
|
+
// specified are inclusive. Byte offsets start at zero.
|
47
|
+
it("positions are inclusive", function () {
|
48
|
+
return serveAndTest("bytes=0-2", 206)
|
49
|
+
.then(function (content) {
|
50
|
+
expect(content.toString('utf-8')).toEqual('012');
|
51
|
+
});
|
52
|
+
});
|
53
|
+
it("last position is optional", function () {
|
54
|
+
return serveAndTest("bytes=0-", 206)
|
55
|
+
.then(function (content) {
|
56
|
+
expect(content.toString('utf-8')).toEqual('01234.txt\n');
|
57
|
+
});
|
58
|
+
});
|
59
|
+
|
60
|
+
// TODO
|
61
|
+
xit("non contiguous ranges", function () {
|
62
|
+
return serveAndTest("bytes=0-2,4-5", 206)
|
63
|
+
.then(function (content) {
|
64
|
+
expect(content.toString('utf-8')).toEqual('0124.');
|
65
|
+
});
|
66
|
+
});
|
67
|
+
|
68
|
+
// If the last-byte-pos value is present, it MUST be greater than
|
69
|
+
// or equal to the first-byte-pos in that byte-range-spec, or the
|
70
|
+
// byte- range-spec is syntactically invalid. The recipient of a
|
71
|
+
// byte-range- set that includes one or more syntactically invalid
|
72
|
+
// byte-range-spec values MUST ignore the header field that
|
73
|
+
// includes that byte-range- set.
|
74
|
+
describe("invalid syntax should be ignored", function () {
|
75
|
+
it("last positions must be greater than first", function () {
|
76
|
+
return serveAndTest("bytes=4-3", 216)
|
77
|
+
.then(function (content) {
|
78
|
+
expect(false).toBe(true);
|
79
|
+
}, function (error) {
|
80
|
+
expect(error.response.status).toBe(416);
|
81
|
+
})
|
82
|
+
});
|
83
|
+
it("if any part is invalid, all of it is invalid", function () {
|
84
|
+
return serveAndTest("bytes=0-2,4-3", 216)
|
85
|
+
.then(function (content) {
|
86
|
+
expect(false).toBe(true);
|
87
|
+
}, function (error) {
|
88
|
+
expect(error.response.status).toBe(416);
|
89
|
+
});
|
90
|
+
});
|
91
|
+
});
|
92
|
+
|
93
|
+
// If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of
|
94
|
+
// the entity-body, last-byte-pos is taken to be equal to one less than the current length of the entity-
|
95
|
+
// body in bytes.
|
96
|
+
describe("last position should be truncated to the length of the content", function () {
|
97
|
+
it("single range", function () {
|
98
|
+
return serveAndTest("bytes=0-10", 206)
|
99
|
+
.then(function (content) {
|
100
|
+
expect(content.toString('utf-8')).toEqual('01234.txt\n');
|
101
|
+
});
|
102
|
+
});
|
103
|
+
// TODO
|
104
|
+
xit("multiple ranges", function () {
|
105
|
+
return serveAndTest("bytes=0-2,1-10", 206)
|
106
|
+
.then(function (content) {
|
107
|
+
expect(content.toString('utf-8')).toEqual('0121234.txt\n');
|
108
|
+
});
|
109
|
+
});
|
110
|
+
});
|
111
|
+
});
|
112
|
+
|
113
|
+
//By its choice of last-byte-pos, a client can limit the number of
|
114
|
+
//bytes retrieved without knowing the size of
|
115
|
+
// the entity.
|
116
|
+
// suffix-byte-range-spec = "-" suffix-length
|
117
|
+
// suffix-length = 1*DIGIT
|
118
|
+
describe("suffix byte range spec", function () {
|
119
|
+
it("can limit the number of bytes retrieved", function () {
|
120
|
+
return serveAndTest("bytes=-3", 206)
|
121
|
+
.then(function (content) {
|
122
|
+
expect(content.toString('utf-8')).toEqual('0123');
|
123
|
+
});
|
124
|
+
});
|
125
|
+
|
126
|
+
// A suffix-byte-range-spec is used to specify the suffix of the
|
127
|
+
// entity-body, of a length given by the suffix-length value. (That
|
128
|
+
// is, this form specifies the last N bytes of an entity-body.) If
|
129
|
+
// the entity is shorter than the specified suffix-length, the
|
130
|
+
// entire entity-body is used.
|
131
|
+
it("last position should be truncated to the length", function () {
|
132
|
+
return serveAndTest("bytes=-20", 206)
|
133
|
+
.then(function (content) {
|
134
|
+
expect(content.toString('utf-8')).toEqual('01234.txt\n');
|
135
|
+
});
|
136
|
+
});
|
137
|
+
});
|
138
|
+
|
139
|
+
// If a syntactically valid byte-range-set includes at least one byte-
|
140
|
+
// range-spec whose first-byte-pos is less than the current length of
|
141
|
+
// the entity-body, or at least one suffix-byte-range-spec with a non-
|
142
|
+
// zero suffix-length, then the byte-range-set is satisfiable.
|
143
|
+
// Otherwise, the byte-range-set is unsatisfiable. If the
|
144
|
+
// byte-range-set is unsatisfiable, the server SHOULD return a response
|
145
|
+
// with a status of 416 (Requested range not satisfiable). Otherwise,
|
146
|
+
// the server SHOULD return a response with a status of 206 (Partial
|
147
|
+
// Content) containing the satisfiable ranges of the entity-body.
|
148
|
+
describe("satisfiability", function () {
|
149
|
+
it("should return 416 if a byte range spec is unsatisfiable", function () {
|
150
|
+
return serveAndTest("bytes=10-11", 416)
|
151
|
+
.then(function (content) {
|
152
|
+
expect(true).toBeTruthy();
|
153
|
+
}).fail(function () {
|
154
|
+
expect(false).toBeTruthy();
|
155
|
+
});
|
156
|
+
});
|
157
|
+
|
158
|
+
it("should return 416 if a suffix byte range spec is unsatisfiable", function () {
|
159
|
+
return serveAndTest("bytes=1-0", 206)
|
160
|
+
.then(function (content) {
|
161
|
+
expect(true).toBeFalsy();
|
162
|
+
}).fail(function (error) {
|
163
|
+
expect(error.response.status).toBe(416);
|
164
|
+
});
|
165
|
+
});
|
166
|
+
|
167
|
+
it("should return 416 if all byte range spec are unsatisfiable", function () {
|
168
|
+
return serveAndTest("bytes=10-11,-0", 416)
|
169
|
+
.then(function (content) {
|
170
|
+
expect(true).toBeTruthy();
|
171
|
+
}).fail(function () {
|
172
|
+
expect(false).toBeTruthy();
|
173
|
+
});
|
174
|
+
});
|
175
|
+
|
176
|
+
// TODO
|
177
|
+
xit("should return 200 if at least one byte range spec is satisfiable", function () {
|
178
|
+
return serveAndTest("bytes=10-11,0-2", 200)
|
179
|
+
.then(function (content) {
|
180
|
+
expect(content.toString('utf-8')).toEqual('012');
|
181
|
+
});
|
182
|
+
});
|
183
|
+
|
184
|
+
});
|
185
|
+
});
|
186
|
+
});
|
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
require("../lib/jasmine-promise");
|
3
|
+
var Q = require("q");
|
4
|
+
var Http = require("../../http");
|
5
|
+
var Apps = require("../../http-apps");
|
6
|
+
var FS = require("../../fs");
|
7
|
+
|
8
|
+
describe("http proxy", function () {
|
9
|
+
|
10
|
+
it("should work", function () {
|
11
|
+
|
12
|
+
var requestProxy;
|
13
|
+
var responseProxy;
|
14
|
+
var requestActual;
|
15
|
+
var responseActual;
|
16
|
+
|
17
|
+
var app = Apps.Chain()
|
18
|
+
.use(Apps.Trap, function (response) {
|
19
|
+
responseActual = response;
|
20
|
+
return response;
|
21
|
+
})
|
22
|
+
.use(Apps.Tap, function (request) {
|
23
|
+
requestActual = request;
|
24
|
+
})
|
25
|
+
.use(function (next) {
|
26
|
+
return Apps.Branch({
|
27
|
+
"foo": Apps.Branch({
|
28
|
+
"bar": new Apps.Chain()
|
29
|
+
.use(Apps.Cap)
|
30
|
+
.use(function () {
|
31
|
+
return Apps.Content(["Hello, World!"])
|
32
|
+
})
|
33
|
+
.end()
|
34
|
+
})
|
35
|
+
})
|
36
|
+
})
|
37
|
+
.end();
|
38
|
+
|
39
|
+
var server1 = Http.Server(app);
|
40
|
+
|
41
|
+
return Q.when(server1.listen(0))
|
42
|
+
.then(function (server1) {
|
43
|
+
var port = server1.node.address().port;
|
44
|
+
|
45
|
+
var server2 = Http.Server(
|
46
|
+
Apps.Trap(
|
47
|
+
Apps.Tap(
|
48
|
+
Apps.ProxyTree("http://127.0.0.1:" + port + "/foo/"),
|
49
|
+
function (request) {
|
50
|
+
requestProxy = request;
|
51
|
+
}
|
52
|
+
),
|
53
|
+
function (response) {
|
54
|
+
responseProxy = response;
|
55
|
+
return response;
|
56
|
+
}
|
57
|
+
)
|
58
|
+
);
|
59
|
+
|
60
|
+
return [server1, server2.listen(0)];
|
61
|
+
})
|
62
|
+
.spread(function (server1, server2) {
|
63
|
+
var port = server2.node.address().port;
|
64
|
+
return Http.read({
|
65
|
+
url: "http://127.0.0.1:" + port + "/bar",
|
66
|
+
charset: "utf-8"
|
67
|
+
})
|
68
|
+
.then(function (content) {
|
69
|
+
expect(content).toBe("Hello, World!");
|
70
|
+
expect(requestActual).toBeTruthy();
|
71
|
+
expect(responseActual).toBeTruthy();
|
72
|
+
expect(requestProxy).toBeTruthy();
|
73
|
+
expect(responseProxy).toBeTruthy();
|
74
|
+
})
|
75
|
+
.finally(server1.stop)
|
76
|
+
.finally(server2.stop)
|
77
|
+
})
|
78
|
+
|
79
|
+
});
|
80
|
+
|
81
|
+
});
|
82
|
+
|