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 +0,0 @@
|
|
1
|
-
.tmp
|
@@ -1,122 +0,0 @@
|
|
1
|
-
<!-- vim:ts=4:sts=4:sw=4:et:tw=60 -->
|
2
|
-
|
3
|
-
## 1.10.9
|
4
|
-
|
5
|
-
- Fixes bug where the mock file system would not truncate before writing to an
|
6
|
-
existing file. #81
|
7
|
-
|
8
|
-
## 1.10.7-8
|
9
|
-
|
10
|
-
- Fixes support for range content requests, such that Q-IO based web serves can
|
11
|
-
host static audio and video content to the web. Further work needed for the
|
12
|
-
more escoteric non-contiguous multi-range requests.
|
13
|
-
- Allow `copyTree` to write over existing trees. (@nerfin)
|
14
|
-
|
15
|
-
## 1.10.6
|
16
|
-
|
17
|
-
- Restores the "request.terms.host" property to report which host pattern was
|
18
|
-
selected by a host negotiator.
|
19
|
-
|
20
|
-
## 1.10.5
|
21
|
-
|
22
|
-
- Fixes support for host negotiation.
|
23
|
-
|
24
|
-
## 1.10.4
|
25
|
-
|
26
|
-
- Fixes the `followInsecureSymbolicLinks` flag on the file tree HTTP
|
27
|
-
app. (@francoisfrisch)
|
28
|
-
- Fixes an error that gets missed when an HTTP request body is not
|
29
|
-
a proper forEachable. (@OliverJAsh)
|
30
|
-
|
31
|
-
## 1.10.3
|
32
|
-
|
33
|
-
- Fix support of Node 0.6 path separators (@Sevinf)
|
34
|
-
|
35
|
-
## 1.10.2
|
36
|
-
|
37
|
-
- Fix remoteTree for directories containing symbolic links.
|
38
|
-
- Tolerate "." in makeTree
|
39
|
-
- Stream writers now return reliable promises for finishing and flushing.
|
40
|
-
|
41
|
-
## 1.10.0
|
42
|
-
|
43
|
-
- Add support for HTTP agents (@yuxhuang)
|
44
|
-
|
45
|
-
## 1.9.4
|
46
|
-
|
47
|
-
- Updated dependencies
|
48
|
-
|
49
|
-
## 1.9.3
|
50
|
-
|
51
|
-
- Fixes a regression in supporting `FS.read(path, "b")`.
|
52
|
-
|
53
|
-
## 1.9.2
|
54
|
-
|
55
|
-
- Fixes `append` and aligns open flags with the underlying Node, except for
|
56
|
-
the default of UTF-8 if bytewise is not specified in the mode flag.
|
57
|
-
- Add `node` property to `Reader`, as advertised.
|
58
|
-
- Bug fixes
|
59
|
-
|
60
|
-
## 1.9.1
|
61
|
-
|
62
|
-
- Brings the mock file system API up to date with file system as of 1.9.0.
|
63
|
-
|
64
|
-
## 1.9.0
|
65
|
-
|
66
|
-
- Distinguishes `move` and `rename`. `move` will work across file system
|
67
|
-
boundaries.
|
68
|
-
|
69
|
-
## 1.8.0
|
70
|
-
|
71
|
-
- Allows `move` to overwrite the target, or overwrite a target directory if
|
72
|
-
empty.
|
73
|
-
|
74
|
-
## 1.7.2
|
75
|
-
|
76
|
-
- Fixes JSON content HTTP responses.
|
77
|
-
|
78
|
-
## 1.7.1
|
79
|
-
|
80
|
-
- Fixes a bug in the HTTP redirect trap.
|
81
|
-
|
82
|
-
## 1.7.0
|
83
|
-
|
84
|
-
- Added FileTree option followInsecureSymbolicLinks (@francoisfrisch)
|
85
|
-
|
86
|
-
## 0.0.12
|
87
|
-
|
88
|
-
- Addressed Node 0.7.* compatibility. (@strager)
|
89
|
-
- Synchronized Q to 0.8.2.
|
90
|
-
|
91
|
-
## 0.0.11
|
92
|
-
|
93
|
-
- Synchronized Q dependency.
|
94
|
-
|
95
|
-
## 0.0.10
|
96
|
-
|
97
|
-
- Removed spurious log message.
|
98
|
-
|
99
|
-
## 0.0.9
|
100
|
-
|
101
|
-
- Fixed a bug in observing the closing of files. (#1, @hornairs)
|
102
|
-
|
103
|
-
## 0.0.8
|
104
|
-
|
105
|
-
- Reorganized, moved q-io to the top level.
|
106
|
-
- Reved dependencies.
|
107
|
-
- Moved q-io-buffer to its own project.
|
108
|
-
|
109
|
-
## 0.0.3
|
110
|
-
|
111
|
-
- reved up Q to version 0.2 so duck-promises will work
|
112
|
-
|
113
|
-
## 0.0.2
|
114
|
-
|
115
|
-
- added buffer-io
|
116
|
-
- added buffer mode to readers and writers
|
117
|
-
|
118
|
-
## 0.0.1
|
119
|
-
|
120
|
-
- fixed dependency on broken q package
|
121
|
-
- restructured for overlay style packaging compatibility
|
122
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
|
2
|
-
Copyright 2009-2013 Kristopher Michael Kowal. All rights reserved.
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to
|
5
|
-
deal in the Software without restriction, including without limitation the
|
6
|
-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
-
sell copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
-
IN THE SOFTWARE.
|
@@ -1,928 +0,0 @@
|
|
1
|
-
|
2
|
-
[![Build Status](https://secure.travis-ci.org/kriskowal/q-io.png)](http://travis-ci.org/kriskowal/q-io)
|
3
|
-
|
4
|
-
# Q-IO
|
5
|
-
|
6
|
-
Interfaces for IO that make use of promises.
|
7
|
-
|
8
|
-
Q-IO now subsumes all of [Q-HTTP][] and [Q-FS][].
|
9
|
-
|
10
|
-
[Q-HTTP]: https://github.com/kriskowal/q-http
|
11
|
-
[Q-FS]: https://github.com/kriskowal/q-fs
|
12
|
-
|
13
|
-
The Q-IO package does not export a main module. You must reach in
|
14
|
-
directly for `q-io/fs`, `q-io/http`, and `q-io/http-apps`.
|
15
|
-
|
16
|
-
## Filesystem
|
17
|
-
|
18
|
-
```javascript
|
19
|
-
var FS = require("q-io/fs");
|
20
|
-
```
|
21
|
-
|
22
|
-
File system API for Q promises with method signatures patterned after
|
23
|
-
[CommonJS/Fileystem/A](http://wiki.commonjs.org/wiki/Filesystem/A) but
|
24
|
-
returning promises and promise streams.
|
25
|
-
|
26
|
-
### open(path, options)
|
27
|
-
|
28
|
-
Open returns a promise for either a buffer or string Reader or a Writer
|
29
|
-
depending on the flags.
|
30
|
-
|
31
|
-
The options can be omitted, abbreviated to a `flags` string, or expanded
|
32
|
-
to an `options` object.
|
33
|
-
|
34
|
-
- ``flags``: ``r``, ``w``, ``a``, ``b``, default of `r`, not bytewise
|
35
|
-
- ``charset``: default of ``utf-8``
|
36
|
-
- ``bufferSize``: in bytes
|
37
|
-
- ``mode``: UNIX permissions
|
38
|
-
- ``begin`` first byte to read (defaults to zero)
|
39
|
-
- ``end`` one past the last byte to read. ``end - begin == length``
|
40
|
-
|
41
|
-
### read(path, options)
|
42
|
-
|
43
|
-
`read` is a shortcut for opening a file and reading the entire contents
|
44
|
-
into memory. It returns a promise for the whole file contents. By
|
45
|
-
default, `read` provides a string decoded from UTF-8. With the bytewise
|
46
|
-
mode flag, provides a `Buffer`.
|
47
|
-
|
48
|
-
The options argument is identical to that of `open`.
|
49
|
-
|
50
|
-
```javascript
|
51
|
-
return FS.read(__filename, "b")
|
52
|
-
.then(function (content) {
|
53
|
-
// ...
|
54
|
-
})
|
55
|
-
```
|
56
|
-
|
57
|
-
```javascript
|
58
|
-
return FS.read(__filename, {
|
59
|
-
flags: "b"
|
60
|
-
})
|
61
|
-
```
|
62
|
-
|
63
|
-
### write(path, content, options)
|
64
|
-
|
65
|
-
`write` is a shortcut for opening a file and writing its entire content
|
66
|
-
from a single string or buffer.
|
67
|
-
|
68
|
-
The options are identical to that of `open`, but the "w" flag is
|
69
|
-
implied, and the "b" flag is implied if the content is a buffer.
|
70
|
-
|
71
|
-
```javascript
|
72
|
-
return FS.write("hello.txt", "Hello, World!\n")
|
73
|
-
.then(function () {
|
74
|
-
return FS.read("hello.txt")
|
75
|
-
})
|
76
|
-
.then(function (hello) {
|
77
|
-
expect(hello).toBe("Hello, World!\n")
|
78
|
-
})
|
79
|
-
```
|
80
|
-
|
81
|
-
### append(path, content, options)
|
82
|
-
|
83
|
-
`append` is a shorthand for opening a file for writing from the end of
|
84
|
-
the existing content from a single string or buffer.
|
85
|
-
|
86
|
-
The options are identical to that of `open`, but the "w+" flags are
|
87
|
-
implied, and the "b" flag is implied if the content is a buffer.
|
88
|
-
|
89
|
-
### copy(source, target)
|
90
|
-
|
91
|
-
Copies a single file from one path to another. The target must be the
|
92
|
-
full path, including the file name. Unlike at the shell, the file name
|
93
|
-
is not inferred from the source path if the target turns out to be a
|
94
|
-
directory.
|
95
|
-
|
96
|
-
Returns a promise for the completion of the operation.
|
97
|
-
|
98
|
-
### copyTree(source, target)
|
99
|
-
|
100
|
-
Copies a file or tree of files from one path to another. Symbolic links
|
101
|
-
are copied but not followed.
|
102
|
-
|
103
|
-
Returns a promise for the completion of the operation.
|
104
|
-
|
105
|
-
### list(path)
|
106
|
-
|
107
|
-
Returns a promise for a list of file names in a directory. The file
|
108
|
-
names are relative to the given path.
|
109
|
-
|
110
|
-
### listTree(path, guard(path, stat))
|
111
|
-
|
112
|
-
Returns a promise for a list of files in a directory and all the
|
113
|
-
directories it contains. Does not follow symbolic links.
|
114
|
-
|
115
|
-
The second argument is an optional guard function that determines what
|
116
|
-
files to include and whether to traverse into another directory. It
|
117
|
-
receives the path of the file, relative to the starting path, and also
|
118
|
-
the stats object for that file. The guard must return a value like:
|
119
|
-
|
120
|
-
- `true` indicates that the entry should be included
|
121
|
-
- `false` indicates that the file should be excluded, but should still
|
122
|
-
be traversed if it is a directory.
|
123
|
-
- `null` indiciates that a directory should not be traversed.
|
124
|
-
|
125
|
-
### listDirectoryTree(path)
|
126
|
-
|
127
|
-
Returns a promise for a deep list of directories.
|
128
|
-
|
129
|
-
### makeDirectory(path, mode)
|
130
|
-
|
131
|
-
Makes a directory at a given path. Fails if the parent directory does
|
132
|
-
not exist. Returns a promise for the completion of the operation.
|
133
|
-
|
134
|
-
The mode is an optional Unix mode as an integer or string of octal
|
135
|
-
digits.
|
136
|
-
|
137
|
-
### makeTree(path, mode)
|
138
|
-
|
139
|
-
Finishes a path of directories. For any branch of the path that does
|
140
|
-
not exist, creates a directory. Fails if any branch of the path already
|
141
|
-
exists but is not a directory.
|
142
|
-
|
143
|
-
Makes any directories with the given Unix mode.
|
144
|
-
|
145
|
-
### remove(path)
|
146
|
-
|
147
|
-
Removes a file at the given path. Fails if a directory exists at the
|
148
|
-
given path or if no file exists at the path.
|
149
|
-
|
150
|
-
### removeTree(path)
|
151
|
-
|
152
|
-
Removes a file or directory at a given path, recursively removing any
|
153
|
-
contained files and directories, without following symbolic links.
|
154
|
-
|
155
|
-
### rename(source, target)
|
156
|
-
|
157
|
-
Moves a file or directory from one path to another using the underlying
|
158
|
-
`rename(2)` implementation, thus it cannot move a file across devices.
|
159
|
-
|
160
|
-
### move(source, target)
|
161
|
-
|
162
|
-
Moves a file or directory from one path to another. If the source and
|
163
|
-
target are on different devices, falls back to copying and removing,
|
164
|
-
using `copyTree(source, target)` and, if completely successful,
|
165
|
-
`removeTree(source)`.
|
166
|
-
|
167
|
-
### link(source, taget)
|
168
|
-
|
169
|
-
Creates a hard link from the source
|
170
|
-
|
171
|
-
### symbolicCopy(source, target, type)
|
172
|
-
|
173
|
-
Creates a relative symoblic link from the target to the source with an
|
174
|
-
effect that resembles copying a file.
|
175
|
-
|
176
|
-
The type is important for Windows. It is "file" by default, but may be
|
177
|
-
"directory" or "junction".
|
178
|
-
|
179
|
-
### symbolicLink(target, link, type)
|
180
|
-
|
181
|
-
Creates a symbolic link at the target path. The link may be absolute or
|
182
|
-
relative. The type *must* be "file", "directory", or "junction" and is
|
183
|
-
mandatory to encourage Windows portability.
|
184
|
-
|
185
|
-
### chown(path, uid, gid)
|
186
|
-
|
187
|
-
Changes the owner for a path using Unix user-id and group-id numbers.
|
188
|
-
|
189
|
-
### chmod(path, mode)
|
190
|
-
|
191
|
-
Changes the Unix mode for a path. Returns a promise.
|
192
|
-
|
193
|
-
### stat(path)
|
194
|
-
|
195
|
-
Follows all symoblic links along a path and returns a promise for the
|
196
|
-
metadata about a path as a `Stats` object. The Stats object implements:
|
197
|
-
|
198
|
-
- `size` the size of the file in bytes
|
199
|
-
- `isDirectory()`: returns whether the path refers to a directory with
|
200
|
-
entries for other paths.
|
201
|
-
- `isFile()`: returns whether the path refers to a file physically
|
202
|
-
stored by the file system.
|
203
|
-
- `isBlockDevice()`: returns whether the path refers to a Unix device
|
204
|
-
driver, in which case there is no actual data in storage but the
|
205
|
-
operating system may allow you to communicate with the driver as a
|
206
|
-
blocks of memory.
|
207
|
-
- `isCharacterDevice()`: returns whether the path refers to a Unix
|
208
|
-
device driver, in which case there is no actual data in storage but
|
209
|
-
the operating system may allow you to communicate with the driver as
|
210
|
-
a stream.
|
211
|
-
- `isSymbolicLink()`: returns whether the path refers to a symbolic
|
212
|
-
link or junction. Stats for symbolic links are only discoverable
|
213
|
-
through `statLink` since `stat` follows symbolic links.
|
214
|
-
- `isFIFO()`: returns whether the path refers to a Unix named pipe.
|
215
|
-
- `isSocket()`: returns whether the path refers to a Unix domain
|
216
|
-
socket.
|
217
|
-
- `lastModified()`: returns the last time the path was opened for
|
218
|
-
writing as a `Date`
|
219
|
-
- `lastAccessed()`: returns the last time the path was opened for
|
220
|
-
reading or writing as a `Date`
|
221
|
-
|
222
|
-
### statLink(path)
|
223
|
-
|
224
|
-
Returns a promise for the `Stats` for a path without following symbolic
|
225
|
-
links.
|
226
|
-
|
227
|
-
### statFd(fd)
|
228
|
-
|
229
|
-
Returns a promise for the `Stats` for a Unix file descriptor number.
|
230
|
-
|
231
|
-
### exists(path)
|
232
|
-
|
233
|
-
Follows symoblic links and returns a promise for whether an entry exists
|
234
|
-
at a given path.
|
235
|
-
|
236
|
-
### isFile(path)
|
237
|
-
|
238
|
-
Follows symbolic links and returns a promise for whether a file exists
|
239
|
-
at a given path and does not cause an exception if nothing exists at
|
240
|
-
that path.
|
241
|
-
|
242
|
-
### isDirectory(path)
|
243
|
-
|
244
|
-
Follows symbolic links and returns a promise for whether a directory
|
245
|
-
exists at a given path and does not cause an exception if nothing exists
|
246
|
-
at that path.
|
247
|
-
|
248
|
-
### isSymbolicLink(path)
|
249
|
-
|
250
|
-
Returns a promise for whether a symbolic link exists at a given path and
|
251
|
-
does not cause an exception if nothing exists at that path.
|
252
|
-
|
253
|
-
### lastModified(path)
|
254
|
-
|
255
|
-
Follows symbolic links and returns a promise for the `Date` when the
|
256
|
-
entry at the given path was last opened for writing, but causes an
|
257
|
-
exception if no file exists at that path.
|
258
|
-
|
259
|
-
### lastAccessed(path)
|
260
|
-
|
261
|
-
Follows symbolic links and returns a promise for the `Date` when the
|
262
|
-
entry at the given path was last opened for reading or writing, but
|
263
|
-
causes an exception if no file exists at that path.
|
264
|
-
|
265
|
-
### split(path)
|
266
|
-
|
267
|
-
Splits a path into the names of entries along the path. If the path is
|
268
|
-
absolute, the first component is either a drive (with a colon) on
|
269
|
-
Windows or an empty string for the root of a Unix file system.
|
270
|
-
|
271
|
-
### join(paths) or join(...paths)
|
272
|
-
|
273
|
-
Joins a sequence of paths into a single normalized path. All but the
|
274
|
-
last path are assumed to refer to directories.
|
275
|
-
|
276
|
-
### resolve(...paths)
|
277
|
-
|
278
|
-
Like join but treats each path like a relative URL, so a terminating
|
279
|
-
slash indicates that a path is to a directory and the next path begins
|
280
|
-
at that directory.
|
281
|
-
|
282
|
-
### normal(...paths)
|
283
|
-
|
284
|
-
Takes a single path or sequence of paths and joins them into a single
|
285
|
-
path, eliminating self `.` and parent `..` entries when possible.
|
286
|
-
|
287
|
-
### absolute(path)
|
288
|
-
|
289
|
-
Joins and normalizes a path from the current working directory,
|
290
|
-
returning a string.
|
291
|
-
|
292
|
-
### canonical(path)
|
293
|
-
|
294
|
-
Returns a promise for the absolute, canonical location of a given path,
|
295
|
-
following symbolic links and normalizing path components. An entry does
|
296
|
-
not need to exist at the end of the path.
|
297
|
-
|
298
|
-
### readLink(path)
|
299
|
-
|
300
|
-
Returns a promise for the path string of a symbolic link at a given
|
301
|
-
path.
|
302
|
-
|
303
|
-
### contains(parent, child)
|
304
|
-
|
305
|
-
For any two absolute or relative paths, computes whether the parent path
|
306
|
-
is an ancestor of the child path.
|
307
|
-
|
308
|
-
### relative(source, target)
|
309
|
-
|
310
|
-
Returns a promise for the relative path from one path to another using
|
311
|
-
`..` parent links where necessary. This operation is asynchronous
|
312
|
-
because it is necessary to determine whether the source path refers to a
|
313
|
-
directory or a file.
|
314
|
-
|
315
|
-
### relativeFromFile(source, target)
|
316
|
-
|
317
|
-
Assuming that the source path refers to a file, returns a string for the
|
318
|
-
relative path from the source to the target path.
|
319
|
-
|
320
|
-
### relativeFromDirectory(source, target)
|
321
|
-
|
322
|
-
Assuming that the source path refers to a directory, returns a string
|
323
|
-
for the relative path from the source to the target path.
|
324
|
-
|
325
|
-
### isAbsolute(path)
|
326
|
-
|
327
|
-
Returns whether a path begins at the root of a Unix file system or a
|
328
|
-
Windows drive.
|
329
|
-
|
330
|
-
### isRelative(path)
|
331
|
-
|
332
|
-
Returns whether a path does not begin at the root of a Unix file system
|
333
|
-
or Windows drive.
|
334
|
-
|
335
|
-
### isRoot(path)
|
336
|
-
|
337
|
-
Returns whether a path is to the root of a Unix file system or a Windows
|
338
|
-
drive.
|
339
|
-
|
340
|
-
### root(path)
|
341
|
-
|
342
|
-
Returns the Windows drive that contains a given path, or the root of a
|
343
|
-
Unix file system.
|
344
|
-
|
345
|
-
### directory(path)
|
346
|
-
|
347
|
-
Returns the path to the directory containing the given path.
|
348
|
-
|
349
|
-
### base(path, extension)
|
350
|
-
|
351
|
-
Returns the last entry of a path. If an extension is provided and
|
352
|
-
matches the extension of the path, removes that extension.
|
353
|
-
|
354
|
-
### extension(path)
|
355
|
-
|
356
|
-
Returns the extension for a path (everything following the last dot `.`
|
357
|
-
in a path, unless that dot is at the beginning of the entry).
|
358
|
-
|
359
|
-
### reroot(path)
|
360
|
-
|
361
|
-
Returns an attenuated file system that uses the given path as its root.
|
362
|
-
The resulting file system object is identical to the parent except that
|
363
|
-
the child cannot open any file that is not within the root. Hard links
|
364
|
-
are effectively inside the root regardless, but symbolic links cannot be
|
365
|
-
followed outside of the jail.
|
366
|
-
|
367
|
-
### toObject(path)
|
368
|
-
|
369
|
-
Reads every file in the file system under a given path and returns a
|
370
|
-
promise for an object that contains the absolute path and a Buffer for
|
371
|
-
each of those files.
|
372
|
-
|
373
|
-
### glob(pattern)
|
374
|
-
|
375
|
-
Not yet implemented
|
376
|
-
|
377
|
-
### match(pattern, path)
|
378
|
-
|
379
|
-
Not yet implemented
|
380
|
-
|
381
|
-
## Mock Filesystem
|
382
|
-
|
383
|
-
Q-IO provides a mock filesystem interface. The mock filesystem has the
|
384
|
-
same interface as the real one and has most of the same features, but
|
385
|
-
operates on a purely in-memory, in-process, in-javascript filesystem.
|
386
|
-
|
387
|
-
A mock filesystem can be created from a data structure. Objects are
|
388
|
-
directories. Keys are paths. A buffer is a file’s contents. Anything
|
389
|
-
else is coerced to a string, then to a buffer in the UTF-8 encoding.
|
390
|
-
|
391
|
-
```javascript
|
392
|
-
var MockFs = require("q-io/fs-mock");
|
393
|
-
var mockFs = MockFs({
|
394
|
-
"a": {
|
395
|
-
"b": {
|
396
|
-
"c.txt": "Content of a/b/c.txt"
|
397
|
-
}
|
398
|
-
},
|
399
|
-
"a/b/d.txt": new Buffer("Content of a/b/d.txt", "utf-8")
|
400
|
-
})
|
401
|
-
```
|
402
|
-
|
403
|
-
You can also instantiate a mock file system with the content of a
|
404
|
-
subtree of a real file system. You receive a promise for the mock
|
405
|
-
filesystem.
|
406
|
-
|
407
|
-
```javascript
|
408
|
-
var FS = require("q-io/fs");
|
409
|
-
FS.mock(__dirname)
|
410
|
-
.then(function (fs) {
|
411
|
-
//
|
412
|
-
})
|
413
|
-
.done();
|
414
|
-
```
|
415
|
-
|
416
|
-
## HTTP
|
417
|
-
|
418
|
-
The HTTP module resembles [CommonJS/JSGI][].
|
419
|
-
|
420
|
-
```javascript
|
421
|
-
var HTTP = require("q-io/http");
|
422
|
-
```
|
423
|
-
|
424
|
-
[CommonJS/JSGI]: http://wiki.commonjs.org/wiki/JSGI
|
425
|
-
|
426
|
-
### Server(app)
|
427
|
-
|
428
|
-
The `http` module exports a `Server` constructor.
|
429
|
-
|
430
|
-
- accepts an application, returns a server.
|
431
|
-
- calls the application function when requests are received.
|
432
|
-
- if the application returns a response object, sends that
|
433
|
-
response.
|
434
|
-
- ``listen(port)``
|
435
|
-
- accepts a port number.
|
436
|
-
- returns a promise for undefined when the server has begun
|
437
|
-
listening.
|
438
|
-
- ``stop()``
|
439
|
-
- returns a promise for undefined when the server has stopped.
|
440
|
-
|
441
|
-
### request(request object or url)
|
442
|
-
|
443
|
-
The `http` module exports a `request` function that returns a promise
|
444
|
-
for a response.
|
445
|
-
|
446
|
-
- accepts a request or a URL string.
|
447
|
-
- returns a promise for a response.
|
448
|
-
|
449
|
-
### read(request object or url)
|
450
|
-
|
451
|
-
The `http` module exports a `read` function, analogous to
|
452
|
-
`Fs.read(path)`, but returning a promise for the contento of an OK HTTP
|
453
|
-
response.
|
454
|
-
|
455
|
-
- accepts a request or a URL string.
|
456
|
-
- returns a promise for the response body as a string provided
|
457
|
-
that the request is successful with a 200 status.
|
458
|
-
- rejects the promise with the response as the reason for
|
459
|
-
failure if the request fails.
|
460
|
-
|
461
|
-
### normalizeRequest(request object or url)
|
462
|
-
|
463
|
-
- coerces URLs into request objects.
|
464
|
-
- completes an incomplete request object based on its `url`.
|
465
|
-
|
466
|
-
### normalizeResponse(response)
|
467
|
-
|
468
|
-
- coerces strings, arrays, and other objects supporting
|
469
|
-
``forEach`` into proper response objects.
|
470
|
-
- if it receives `undefined`, it returns `undefined`. This is used as
|
471
|
-
a singal to the requester that the responder has taken control of
|
472
|
-
the response stream.
|
473
|
-
|
474
|
-
### request
|
475
|
-
|
476
|
-
A complete request object has the following properties.
|
477
|
-
|
478
|
-
- ``url`` the full URL of the request as a string
|
479
|
-
- ``path`` the full path as a string
|
480
|
-
- ``scriptName`` the routed portion of the path, like ``""`` for
|
481
|
-
``http://example.com/`` if no routing has occurred.
|
482
|
-
- ``pathInfo`` the part of the path that remains to be routed,
|
483
|
-
like ``/`` for ``http://example.com`` or ``http://example.com/``
|
484
|
-
if no routing has occurred.
|
485
|
-
- ``version`` the requested HTTP version as an array of strings.
|
486
|
-
- ``method`` like ``"GET"``
|
487
|
-
- ``scheme`` like ``"http:"``
|
488
|
-
- ``host`` like ``"example.com"``
|
489
|
-
- ``port`` the port number, like ``80``
|
490
|
-
- ``remoteHost``
|
491
|
-
- ``remotePort``
|
492
|
-
- ``headers``
|
493
|
-
corresponding values, possibly an array for multiple headers
|
494
|
-
of the same name.
|
495
|
-
- ``agent``
|
496
|
-
a custom node [HTTP](http://nodejs.org/api/http.html#http_class_http_agent)
|
497
|
-
or [HTTPS](http://nodejs.org/api/https.html#https_class_https_agent)
|
498
|
-
agent. HTTP and HTTPS agents can implement custom socket pools,
|
499
|
-
allow use of SSL client certificates and self-signed certificates.
|
500
|
-
- ``body``
|
501
|
-
- ``node`` the wrapped Node request object
|
502
|
-
|
503
|
-
### response
|
504
|
-
|
505
|
-
A complete response object has the following properties.
|
506
|
-
|
507
|
-
- ``status`` the HTTP status code as a number, like ``200``.
|
508
|
-
- ``headers``
|
509
|
-
- ``body`` an IO reader
|
510
|
-
- ``onclose`` is an optional function that this library will call
|
511
|
-
when a response concludes.
|
512
|
-
- ``node`` the wrapped Node response object.
|
513
|
-
|
514
|
-
### headers
|
515
|
-
|
516
|
-
Headers are an object mapping lower-case header-names to corresponding
|
517
|
-
values, possibly an array for multiple headers of the same name, for
|
518
|
-
both requests and responses.
|
519
|
-
|
520
|
-
### body
|
521
|
-
|
522
|
-
body is a representation of a readable stream, either for the content of
|
523
|
-
a request or a response. It is implemented as a Q-IO reader.
|
524
|
-
|
525
|
-
- ``forEach(callback)``
|
526
|
-
- accepts a ``callback(chunk)`` function
|
527
|
-
- accepts a chunk as either a string or a ``Buffer``
|
528
|
-
- returns undefined or a promise for undefined when the
|
529
|
-
chunk has been flushed.
|
530
|
-
- returns undefined or a promise for undefined when the stream
|
531
|
-
is finished writing.
|
532
|
-
- the ``forEach`` function for arrays of strings or buffers is
|
533
|
-
sufficient for user-provided bodies
|
534
|
-
- the ``forEach`` function is the only necessary function for
|
535
|
-
bodies provided to this library.
|
536
|
-
- in addition to ``forEach``, bodies provided by this library
|
537
|
-
support the entire readable stream interface provided by
|
538
|
-
``q-io``.
|
539
|
-
- ``read()``
|
540
|
-
- returns a promise for the entire body as a string or a
|
541
|
-
buffer.
|
542
|
-
|
543
|
-
### application
|
544
|
-
|
545
|
-
An HTTP application is a function that accepts a request and returns a
|
546
|
-
response. The `request` function itself is an application.
|
547
|
-
Applications can be chained and combined to make advanced servers and
|
548
|
-
clients.
|
549
|
-
|
550
|
-
- accepts a request
|
551
|
-
- returns a response, a promise for a response, or nothing if no
|
552
|
-
response should be sent.
|
553
|
-
|
554
|
-
|
555
|
-
## Streams
|
556
|
-
|
557
|
-
### Reader
|
558
|
-
|
559
|
-
Reader instances have the following methods:
|
560
|
-
|
561
|
-
- `read()`
|
562
|
-
- `forEach(callback)`
|
563
|
-
- `close()`
|
564
|
-
- `node` the underlying node reader
|
565
|
-
|
566
|
-
Additionally, the `Reader` constructor has the following methods:
|
567
|
-
|
568
|
-
- `read(stream, charset)` accepts any foreachable and returns either a
|
569
|
-
buffer or a string if given a charset.
|
570
|
-
- `join(buffers)` consolidates an array of buffers into a single
|
571
|
-
buffer. The buffers array is collapsed in place and the new first
|
572
|
-
and only buffer is returned.
|
573
|
-
|
574
|
-
The `reader` module exports a function that accepts a Node reader and
|
575
|
-
returns a Q reader.
|
576
|
-
|
577
|
-
### Writer
|
578
|
-
|
579
|
-
Writer instances have the following methods:
|
580
|
-
|
581
|
-
- `write(content)` writes a chunk of content, either from a string or
|
582
|
-
a buffer.
|
583
|
-
- `flush()` returns a promise to drain the outbound content all the
|
584
|
-
way to its destination.
|
585
|
-
- `close()`
|
586
|
-
- `destroy()`
|
587
|
-
- `node` the underlying node writer
|
588
|
-
|
589
|
-
The `writer` module exports a function that accepts a Node writer and
|
590
|
-
returns a Q writer.
|
591
|
-
|
592
|
-
### Buffer
|
593
|
-
|
594
|
-
```javascript
|
595
|
-
var BufferStream = require("q-io/buffer-stream");
|
596
|
-
var stream = BufferStream(new Buffer("Hello, World!\n", "utf-8"), "utf-8")
|
597
|
-
```
|
598
|
-
|
599
|
-
## HTTP Applications
|
600
|
-
|
601
|
-
The HTTP applications module provides a comprehensive set of JSGI-alike
|
602
|
-
applications and application factories, suitable for use with the `http`
|
603
|
-
server and client.
|
604
|
-
|
605
|
-
```javascript
|
606
|
-
var Apps = require("q-io/http-apps");
|
607
|
-
```
|
608
|
-
|
609
|
-
### ok(content, contentType, status) : Response
|
610
|
-
|
611
|
-
Creates an `HTTP 200 Ok` response with the given content, content type,
|
612
|
-
and status.
|
613
|
-
|
614
|
-
The content may be a string, buffer, array of strings, array of buffers,
|
615
|
-
a readable stream of strings or buffers, or (generally) anything that
|
616
|
-
implements `forEach`.
|
617
|
-
|
618
|
-
The default content type is `text/plain`.
|
619
|
-
|
620
|
-
The default status is `200`.
|
621
|
-
|
622
|
-
### badRequest(request) : Response
|
623
|
-
|
624
|
-
An application that returns an `HTTP 400 Bad request` response for any
|
625
|
-
request.
|
626
|
-
|
627
|
-
### notFound(request) : Response
|
628
|
-
|
629
|
-
An application that returns an `HTTP 404 Not found` response for any
|
630
|
-
request.
|
631
|
-
|
632
|
-
### methodNotAllowed(request) : Response
|
633
|
-
|
634
|
-
An application that returns an `HTTP 405 Method not allowed` response
|
635
|
-
for any request. This is suitable for any endpoint where there is no
|
636
|
-
viable handler for the request method.
|
637
|
-
|
638
|
-
### notAcceptable(request) : Response
|
639
|
-
|
640
|
-
An application that returns an `HTTP 406 Not acceptable` response for
|
641
|
-
any request. This is suitable for any situation where content
|
642
|
-
negotiation has failed, for example, if you cannot response with any of
|
643
|
-
the accepted encoding, charset, or language.
|
644
|
-
|
645
|
-
### redirect(request, location, status, tree) : Response
|
646
|
-
|
647
|
-
Not to be confused with an HTTP application, this is a utility that
|
648
|
-
generates redirect responses.
|
649
|
-
|
650
|
-
The returns response issues a redirect to the given location. The
|
651
|
-
utility fully qualifies the location.
|
652
|
-
|
653
|
-
This particular method should be used directly to generate an `HTTP 301
|
654
|
-
Temporary redirect` response, but passing `307` in the status argument
|
655
|
-
turns it into an `HTTP 307 Permanent redirect` response.
|
656
|
-
|
657
|
-
This particular method should be used to send all requests to a specific
|
658
|
-
location, but setting the `tree` argument to `true` causes the redirect
|
659
|
-
to follow the remaining unrouted path from the redirect location, so if
|
660
|
-
you move an entire directory tree from one location to another, this
|
661
|
-
redirect can forward to all of them.
|
662
|
-
|
663
|
-
### redirectTree(request, location) : Response
|
664
|
-
|
665
|
-
Produces an `HTTP 301 Temporary redirect` from one directory tree to
|
666
|
-
another, using `redirect`.
|
667
|
-
|
668
|
-
### permanentRedirect(request, location) : Response
|
669
|
-
|
670
|
-
Produces an `HTTP 307 Permanent redirect` to a given location, using
|
671
|
-
`redirect`.
|
672
|
-
|
673
|
-
### permanentRedirectTree(request, location) : Response
|
674
|
-
|
675
|
-
Produces an `HTTP 307 Permanent redirect` from one directory tree to
|
676
|
-
another, using `redirect`.
|
677
|
-
|
678
|
-
### file(request, path, contentType) : Response
|
679
|
-
|
680
|
-
Produces an HTTP response with the file at a given path. By default, it
|
681
|
-
infers the content type from the extension of the path.
|
682
|
-
|
683
|
-
The file utility produces an `e-tag` header suitable for cache control,
|
684
|
-
and may produce an `HTTP 304 Not modified` if the requested resource has
|
685
|
-
the same entity tag.
|
686
|
-
|
687
|
-
The file utility may produce an `HTTP 206 Partial content` response with
|
688
|
-
a `content-range` header if the request has a `range` header. If the
|
689
|
-
partial range request cannot be satisified, it may respond `HTTP 416 Not
|
690
|
-
satisfiable`.
|
691
|
-
|
692
|
-
In all cases, the response body is streamed from the file system.
|
693
|
-
|
694
|
-
### etag(stat)
|
695
|
-
|
696
|
-
Computes an entity tag for a file system `Stats` object, using the
|
697
|
-
`node.ino`, `size`, and last modification time.
|
698
|
-
|
699
|
-
### directory(request, path)
|
700
|
-
|
701
|
-
This is not yet implemented.
|
702
|
-
|
703
|
-
### json(object, visitor, tabs) : Response
|
704
|
-
|
705
|
-
Returns an `HTTP 200 Ok` response from some JSON, using the same
|
706
|
-
argumensts as `JSON.stringify`.
|
707
|
-
|
708
|
-
### Content(body, contentType, status) : Application
|
709
|
-
|
710
|
-
A factory that produces an HTTP application that will always respond
|
711
|
-
with the given content, content type, and status. The default content
|
712
|
-
type is `text/plain` and the default status is `200`.
|
713
|
-
|
714
|
-
The body may be a string, array of strings or buffers, or a readable
|
715
|
-
stream of strings or buffers.
|
716
|
-
|
717
|
-
### File(path, contentType) : Application
|
718
|
-
|
719
|
-
A factory that produces an HTTP application that will always respond
|
720
|
-
with the file at the given path. The content type is inferred from the
|
721
|
-
path extension by default, but can be overridden with `contentType`.
|
722
|
-
|
723
|
-
### FileTree(path, options) : Application
|
724
|
-
|
725
|
-
A factory that produces an HTTP application that responds to all
|
726
|
-
requests with files within a branch of the file system starting at the
|
727
|
-
given path and using any unprocessed portion of the request location.
|
728
|
-
|
729
|
-
Options include:
|
730
|
-
|
731
|
-
- `notFound(request, response)`: alternate 404 responder, defaults to
|
732
|
-
`HttpApps.notFound`
|
733
|
-
- `file(request, path, contentType, fs)`: alternate file responder,
|
734
|
-
defaults to `HttpApps.file`
|
735
|
-
- `contentType`: forces the content type of file requests, forwarded
|
736
|
-
to the `file` handler.
|
737
|
-
- `directory(request, path, contentType, fs)`: alternate directory
|
738
|
-
responder, defaults to `HttpApps.directory`.
|
739
|
-
- `redirectSymbolicLinks`: directs the client to use a redirect
|
740
|
-
response for symbolic links instead of following links internally.
|
741
|
-
- `permanent`: symbolic links that are turned into HTTP redirects will
|
742
|
-
be permanent.
|
743
|
-
- `followInsecureSymbolicLinks`: directs `FileTree` to serve files
|
744
|
-
that are outside the root path of the file tree if a symbolic link
|
745
|
-
traverses there.
|
746
|
-
- `fs`: alternate file system, defaults to the `fs` module.
|
747
|
-
|
748
|
-
### Redirect(path) : Application
|
749
|
-
|
750
|
-
A factory that produces an HTTP application that temporarily redirects
|
751
|
-
to the given path.
|
752
|
-
|
753
|
-
### RedirectTree(path) : Application
|
754
|
-
|
755
|
-
A factory that produces an HTTP application that redirects all requests
|
756
|
-
under the requested path to parallel locations at the given path.
|
757
|
-
|
758
|
-
### PermanentRedirect(path) : Application
|
759
|
-
|
760
|
-
A factory that produces an HTTP application that redirects all requests
|
761
|
-
to an exact location and instructs the requester's cache never to ask
|
762
|
-
again.
|
763
|
-
|
764
|
-
### PermanentRedirectTree(path) : Application
|
765
|
-
|
766
|
-
A factory that produces an HTTP application that redirects all requests
|
767
|
-
under the request path to a parallel location under the given path and
|
768
|
-
instructs the requester's cache never to ask again.
|
769
|
-
|
770
|
-
### Cap(app, notFound) : Application
|
771
|
-
|
772
|
-
A factory that produces an HTTP application that will cause an `HTTP 404
|
773
|
-
Not found` response if the request has not reached the end of its route
|
774
|
-
(meaning `pathInfo` is not `""` or `"/"`), or will forward to the given
|
775
|
-
application.
|
776
|
-
|
777
|
-
### Routing
|
778
|
-
|
779
|
-
Several routing application factories have the same form. They all take
|
780
|
-
an object as their first argument and an optional fallback application
|
781
|
-
as their second. The object maps each of the supported options for keys
|
782
|
-
to an HTTP application for handling that option.
|
783
|
-
|
784
|
-
- Branch(paths, notFound) routes the next unprocessed path component
|
785
|
-
- Method(methods, notFound) routes the HTTP method. Methods are
|
786
|
-
upper-case.
|
787
|
-
- ContentType(contentTypes, notAcceptable) routes based on the
|
788
|
-
"accept" request header and produces a "content-type" response
|
789
|
-
header.
|
790
|
-
- Langauge(languages, notAcceptable) routes based on the
|
791
|
-
"accept-language" header and produces a "language" response header.
|
792
|
-
- Charaset(charsets, notAcceptable) routes based on the
|
793
|
-
"accept-charset" header and produces a "charset" response header.
|
794
|
-
- Encoding(encodings, notAcceptable) routes based on the
|
795
|
-
"accept-encoding" request header and produces an "encoding" response
|
796
|
-
header.
|
797
|
-
- Host(hosts, notFound) routes based on the host name of the request
|
798
|
-
"host" header, which defaults to "*". This is equivalent to virtual
|
799
|
-
host mapping.
|
800
|
-
|
801
|
-
### Select(selector) : Application
|
802
|
-
|
803
|
-
Produces an HTTP application that uses a function to determine the next
|
804
|
-
application to route. The `selector` is a function that accepts the
|
805
|
-
request and returns an HTTP application.
|
806
|
-
|
807
|
-
### FirstFound(apps)
|
808
|
-
|
809
|
-
Returns an HTTP application that attempts to respond with each of a
|
810
|
-
series of applications and returns the first response that does not have
|
811
|
-
a `404 Not found` status, or whatever response comes last.
|
812
|
-
|
813
|
-
### Error(application, debug) : Application
|
814
|
-
|
815
|
-
Wraps an application such that any exceptions get converted into `HTTP
|
816
|
-
500 Server error` responses. If `debug` is enabled, produces the
|
817
|
-
exception and stack traces in the body of the response.
|
818
|
-
|
819
|
-
### Log(application, log, stamp) : Application
|
820
|
-
|
821
|
-
Wraps an application such that request and response times are logged.
|
822
|
-
The `log` function reports to `console.log` by default. The
|
823
|
-
`stamp(message)` function prefixes an ISO time stamp by default.
|
824
|
-
|
825
|
-
### Time(application) : Application
|
826
|
-
|
827
|
-
Adds an `x-response-time` header to the response, with the time from receiving
|
828
|
-
starting the request to starting the response in miliseconds.
|
829
|
-
|
830
|
-
### Date(application) : Application
|
831
|
-
|
832
|
-
Adds a `date` header to the response with the current date for cache
|
833
|
-
control purposes.
|
834
|
-
|
835
|
-
### Tap(app, tap) : Application
|
836
|
-
|
837
|
-
Wraps an application such that the `tap` function receives the request
|
838
|
-
first. If the tap returns nothing, the request goes to the `app`. If
|
839
|
-
the `tap` returns a response, the `app` never gets called.
|
840
|
-
|
841
|
-
### Trap(app, trap) : Application
|
842
|
-
|
843
|
-
Wraps an application such that the `trap` function receives the
|
844
|
-
response. If it returns nothing, the response if forwarded. If the
|
845
|
-
`trap` returns a response, the original response is discarded.
|
846
|
-
|
847
|
-
### ParseQuery(application)
|
848
|
-
|
849
|
-
Wraps an application such that the query string is parsed and placed in
|
850
|
-
`request.parse`.
|
851
|
-
|
852
|
-
|
853
|
-
## Coverage
|
854
|
-
|
855
|
-
Use `npm run cover` to generate and view a coverage report of Q-IO.
|
856
|
-
|
857
|
-
<table>
|
858
|
-
<thead>
|
859
|
-
<tr>
|
860
|
-
<th>File</th>
|
861
|
-
<th>Percentage</th>
|
862
|
-
<th>Missing</th>
|
863
|
-
</tr>
|
864
|
-
</thead>
|
865
|
-
<tbody>
|
866
|
-
<tr>
|
867
|
-
<td><code>fs-boot.js</code></td>
|
868
|
-
<td>87%</td>
|
869
|
-
<td>41</td>
|
870
|
-
</tr>
|
871
|
-
<tr>
|
872
|
-
<td><code>fs.js</code></td>
|
873
|
-
<td>72%</td>
|
874
|
-
<td>100</td>
|
875
|
-
</tr>
|
876
|
-
<tr>
|
877
|
-
<td><code>reader.js</code></td>
|
878
|
-
<td>94%</td>
|
879
|
-
<td>8</td>
|
880
|
-
</tr>
|
881
|
-
<tr>
|
882
|
-
<td><code>writer.js</code></td>
|
883
|
-
<td>91%</td>
|
884
|
-
<td>8</td>
|
885
|
-
</tr>
|
886
|
-
<tr>
|
887
|
-
<td><code>fs-common.js</code></td>
|
888
|
-
<td>87%</td>
|
889
|
-
<td>52</td>
|
890
|
-
</tr>
|
891
|
-
<tr>
|
892
|
-
<td><code>fs-root.js</code></td>
|
893
|
-
<td>88%</td>
|
894
|
-
<td>11</td>
|
895
|
-
</tr>
|
896
|
-
<tr>
|
897
|
-
<td><code>fs-mock.js</code></td>
|
898
|
-
<td>91%</td>
|
899
|
-
<td>46</td>
|
900
|
-
</tr>
|
901
|
-
<tr>
|
902
|
-
<td><code>buffer-stream.js</code></td>
|
903
|
-
<td>89%</td>
|
904
|
-
<td>6</td>
|
905
|
-
</tr>
|
906
|
-
<tr>
|
907
|
-
<td><code>http.js</code></td>
|
908
|
-
<td>93%</td>
|
909
|
-
<td>25</td>
|
910
|
-
</tr>
|
911
|
-
<tr>
|
912
|
-
<td><code>http-apps.js</code></td>
|
913
|
-
<td>80%</td>
|
914
|
-
<td>286</td>
|
915
|
-
</tr>
|
916
|
-
<tr>
|
917
|
-
<td><code>http-cookie.js</code></td>
|
918
|
-
<td>79%</td>
|
919
|
-
<td>15</td>
|
920
|
-
</tr>
|
921
|
-
</tbody>
|
922
|
-
</table>
|
923
|
-
|
924
|
-
---
|
925
|
-
|
926
|
-
Copyright 2009–2013 Kristopher Michael Kowal
|
927
|
-
MIT License (enclosed)
|
928
|
-
|