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.
- checksums.yaml +8 -8
- data/README.md +2 -2
- data/lib/js/compile.js +7 -15
- data/lib/traceur.rb +2 -1
- data/lib/traceur/compilation_error.rb +27 -0
- data/lib/traceur/compiler.rb +4 -1
- data/lib/traceur/configuration.rb +1 -1
- data/lib/traceur/node/runner.rb +1 -1
- data/lib/traceur/version.rb +1 -1
- data/spec/examples/syntax_error.js +3 -0
- data/spec/integration/examples_spec.rb +6 -0
- data/vendor/node_modules/traceur/LICENSE +202 -0
- data/vendor/node_modules/traceur/README.md +5 -5
- data/vendor/node_modules/traceur/bin/traceur-runtime.js +1392 -623
- data/vendor/node_modules/traceur/bin/traceur.js +24749 -17990
- data/vendor/node_modules/traceur/node_modules/.bin/semver +2 -2
- data/vendor/node_modules/traceur/node_modules/commander/History.md +222 -0
- data/vendor/node_modules/traceur/node_modules/commander/Readme.md +127 -35
- data/vendor/node_modules/traceur/node_modules/commander/index.js +261 -93
- data/vendor/node_modules/traceur/node_modules/commander/package.json +41 -9
- data/vendor/node_modules/traceur/node_modules/glob/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/README.md +357 -0
- data/vendor/node_modules/traceur/node_modules/glob/common.js +177 -0
- data/vendor/node_modules/traceur/node_modules/glob/glob.js +649 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/README.md +37 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/inflight.js +44 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +34 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/package.json +61 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/test.js +97 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/LICENSE +16 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/README.md +42 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits.js +1 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/package.json +33 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/test.js +25 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/README.md +216 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
- 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
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
- 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
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/package.json +60 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/LICENSE +27 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/README.md +51 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +34 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/once.js +21 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/package.json +42 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/test/once.js +23 -0
- data/vendor/node_modules/traceur/node_modules/glob/package.json +72 -0
- data/vendor/node_modules/traceur/node_modules/glob/sync.js +409 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/.release.json +17 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/CHANGELOG.md +165 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/README.md +364 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.js +1671 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.min.js +9 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.js +66 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.umd.js +50 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/-internal.js +265 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all-settled.js +71 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all.js +15 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/asap.js +109 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/config.js +28 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/defer.js +45 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/enumerator.js +125 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/events.js +201 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/filter.js +120 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash-settled.js +124 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash.js +94 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/instrument.js +41 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/map.js +99 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/node.js +281 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise-hash.js +51 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise.js +496 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/all.js +52 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/race.js +105 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/reject.js +47 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/resolve.js +49 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/race.js +15 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/reject.js +16 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/resolve.js +17 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/rethrow.js +46 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/utils.js +39 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/package.json +100 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/README.md +9 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/bower.json +22 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/composer.json +18 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/package.json +52 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.amd.js +1607 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.js +1566 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.min.js +26 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/vertx.js +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/bin/semver +2 -2
- data/vendor/node_modules/traceur/node_modules/semver/package.json +4 -3
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +7 -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 +7 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -1
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/index.js +8 -4
- data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +2 -1
- data/vendor/node_modules/traceur/node_modules/source-map-support/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/mime/LICENSE → source-map-support/LICENSE.md} +7 -5
- data/vendor/node_modules/traceur/node_modules/source-map-support/README.md +165 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/browser-source-map-support.js +89 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/index.html +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/require.js +36 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.coffee +13 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.js +24 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.map +10 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-source-map-support.js +89 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/index.html +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.coffee +12 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.js +25 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.map +10 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/build.js +69 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/index.html +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.coffee +12 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.js +25 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.map +10 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/server.js +45 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/.npmignore +2 -0
- data/vendor/node_modules/traceur/node_modules/{q-io → source-map-support/node_modules/source-map}/.travis.yml +1 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/CHANGELOG.md +121 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/LICENSE +28 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/Makefile.dryice.js +166 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/README.md +434 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js +56 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/mini-require.js +152 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-source-map.jsm +20 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-utils.jsm +18 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-browser.js +8 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-source-map.jsm +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-utils.jsm +21 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-prefix.js +8 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-suffix.js +3 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map.js +8 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/array-set.js +97 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64.js +42 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js +81 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js +371 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js +205 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/README.md +171 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/package.json +37 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/package.json +142 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/run-tests.js +62 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-api.js +26 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-array-set.js +104 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64.js +35 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-node.js +365 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/util.js +161 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/package.json +52 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/source-map-support.js +381 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/test.js +359 -0
- data/vendor/node_modules/traceur/package.json +234 -20
- data/vendor/node_modules/traceur/src/node/NodeCompiler.js +78 -0
- data/vendor/node_modules/traceur/src/node/System.js +32 -5
- data/vendor/node_modules/traceur/src/node/api.js +28 -93
- data/vendor/node_modules/traceur/src/node/command.js +84 -19
- data/vendor/node_modules/traceur/src/node/compileAllJsFilesInDir.js +40 -0
- data/vendor/node_modules/traceur/src/node/interpreter.js +11 -8
- data/vendor/node_modules/traceur/src/node/recursiveModuleCompile.js +171 -0
- data/vendor/node_modules/traceur/src/node/require.js +7 -21
- data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +2 -7
- data/vendor/node_modules/traceur/src/node/to-closure-compiler.js +28 -0
- data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +3 -7
- data/vendor/node_modules/traceur/src/node/traceur.js +1 -1
- metadata +196 -190
- data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +0 -122
- data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/README.md +0 -928
- data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +0 -59
- data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +0 -44
- data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +0 -51
- data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +0 -307
- data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +0 -499
- data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +0 -547
- data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +0 -105
- data/vendor/node_modules/traceur/node_modules/q-io/fs.js +0 -355
- data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +0 -65
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +0 -152
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +0 -24
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +0 -93
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +0 -154
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +0 -178
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +0 -417
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +0 -58
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +0 -78
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +0 -120
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +0 -27
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +0 -209
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +0 -125
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +0 -175
- data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +0 -75
- data/vendor/node_modules/traceur/node_modules/q-io/http.js +0 -378
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +0 -11
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +0 -78
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +0 -21
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +0 -1285
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +0 -22
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +0 -142
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +0 -57
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +0 -183
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +0 -261
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +0 -186
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +0 -55
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +0 -59
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +0 -236
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +0 -371
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +0 -435
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +0 -247
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +0 -147
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +0 -448
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +0 -139
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +0 -79
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +0 -142
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +0 -60
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +0 -41
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +0 -12
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +0 -7
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +0 -48
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +0 -590
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +0 -49
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +0 -173
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +0 -274
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +0 -59
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +0 -538
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +0 -14
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +0 -6
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +0 -49
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +0 -51
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +0 -269
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +0 -61
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +0 -736
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +0 -40
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +0 -66
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +0 -114
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +0 -35
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +0 -84
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +0 -1588
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +0 -77
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +0 -15
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +0 -96
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +0 -166
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +0 -43
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +0 -40
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +0 -813
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +0 -71
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +0 -36
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +0 -93
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +0 -1937
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +0 -35
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +0 -6
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +0 -36
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +0 -7
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +0 -38
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +0 -32
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +0 -39
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +0 -2
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +0 -123
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +0 -128
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +0 -53
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +0 -61
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +0 -856
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +0 -1080
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +0 -377
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +0 -290
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +0 -4
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +0 -16
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +0 -12
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +0 -91
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +0 -12
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +0 -13
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +0 -14
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +0 -146
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +0 -22
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +0 -6
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +0 -248
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +0 -53
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +0 -2
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +0 -91
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +0 -548
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +0 -8
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +0 -358
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +0 -133
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +0 -20
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +0 -33
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +0 -37
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +0 -125
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +0 -151
- data/vendor/node_modules/traceur/node_modules/q-io/package.json +0 -51
- data/vendor/node_modules/traceur/node_modules/q-io/reader.js +0 -133
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +0 -47
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +0 -11
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +0 -33
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +0 -92
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +0 -41
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +0 -57
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +0 -70
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +0 -109
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +0 -67
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +0 -219
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +0 -20
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +0 -26
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +0 -40
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +0 -37
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +0 -39
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +0 -32
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +0 -26
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +0 -86
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +0 -31
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +0 -73
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +0 -23
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +0 -22
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +0 -25
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +0 -45
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +0 -38
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +0 -52
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +0 -86
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +0 -1
- 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 +0 -49
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +0 -47
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +0 -186
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +0 -82
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +0 -110
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +0 -96
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +0 -96
- data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +0 -42
- data/vendor/node_modules/traceur/node_modules/q-io/writer.js +0 -111
- data/vendor/node_modules/traceur/src/node/compile-single-file.js +0 -69
- data/vendor/node_modules/traceur/src/node/compiler.js +0 -116
- data/vendor/node_modules/traceur/src/node/inline-module.js +0 -149
@@ -1,86 +0,0 @@
|
|
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
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
01234.txt
|
@@ -1 +0,0 @@
|
|
1
|
-
1234
|
File without changes
|
File without changes
|
@@ -1,49 +0,0 @@
|
|
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
|
-
|
@@ -1,47 +0,0 @@
|
|
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
|
-
|
@@ -1,186 +0,0 @@
|
|
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
|
-
});
|
@@ -1,82 +0,0 @@
|
|
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
|
-
|