traceur-rb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +22 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +87 -0
- data/Rakefile +2 -0
- data/lib/js/compile.js +31 -0
- data/lib/traceur-rb.rb +1 -0
- data/lib/traceur.rb +43 -0
- data/lib/traceur/compilation_options.rb +65 -0
- data/lib/traceur/compiler.rb +33 -0
- data/lib/traceur/configuration.rb +47 -0
- data/lib/traceur/node.rb +26 -0
- data/lib/traceur/node/command_result.rb +28 -0
- data/lib/traceur/node/runner.rb +40 -0
- data/lib/traceur/version.rb +3 -0
- data/spec/examples/classes.js +12 -0
- data/spec/integration/examples_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/traceur/compilation_options_spec.rb +31 -0
- data/spec/traceur/configuration_spec.rb +54 -0
- data/spec/traceur/node_spec.rb +15 -0
- data/traceur-rb.gemspec +25 -0
- data/vendor/node_modules/.bin/traceur +3 -0
- data/vendor/node_modules/traceur/README.md +40 -0
- data/vendor/node_modules/traceur/bin/traceur-runtime.js +2101 -0
- data/vendor/node_modules/traceur/bin/traceur.js +23034 -0
- data/vendor/node_modules/traceur/node_modules/.bin/semver +125 -0
- data/vendor/node_modules/traceur/node_modules/commander/Readme.md +208 -0
- data/vendor/node_modules/traceur/node_modules/commander/index.js +852 -0
- data/vendor/node_modules/traceur/node_modules/commander/package.json +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/.travis.yml +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +122 -0
- data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/README.md +928 -0
- data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +44 -0
- data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +307 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +499 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +547 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +105 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs.js +355 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +65 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +152 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +24 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +93 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +154 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +178 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +417 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +58 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +78 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +120 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +27 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +209 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +125 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +175 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +75 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http.js +378 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +11 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +78 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +21 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +1285 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +142 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +57 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +183 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +261 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +186 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +55 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +236 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +371 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +435 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +247 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +147 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +448 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +139 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +79 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +142 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +60 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +41 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +7 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +48 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +590 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +173 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +274 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +538 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +14 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +269 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +61 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +736 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +66 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +114 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +35 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +84 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +1588 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +77 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +15 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +166 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +43 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +813 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +71 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +36 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +93 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +1937 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +35 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +36 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +7 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +38 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +32 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +2 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +123 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +128 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +53 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +61 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +856 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +1080 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +377 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +290 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +16 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +91 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +13 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +14 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +146 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +248 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +53 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +2 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +91 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +548 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +8 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +358 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +133 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +20 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +33 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +37 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +125 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +151 -0
- data/vendor/node_modules/traceur/node_modules/q-io/package.json +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/reader.js +133 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +47 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +11 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +33 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +92 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +41 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +57 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +70 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +109 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +67 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +219 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +20 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +26 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +37 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +32 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +26 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +86 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +31 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +73 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +23 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +25 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +45 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +38 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +52 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +86 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +47 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +186 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +82 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +110 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +42 -0
- data/vendor/node_modules/traceur/node_modules/q-io/writer.js +111 -0
- data/vendor/node_modules/traceur/node_modules/semver/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/LICENSE +27 -0
- data/vendor/node_modules/traceur/node_modules/semver/Makefile +24 -0
- data/vendor/node_modules/traceur/node_modules/semver/README.md +158 -0
- data/vendor/node_modules/traceur/node_modules/semver/bin/semver +125 -0
- data/vendor/node_modules/traceur/node_modules/semver/foot.js +6 -0
- data/vendor/node_modules/traceur/node_modules/semver/head.js +2 -0
- data/vendor/node_modules/traceur/node_modules/semver/package.json +31 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +1039 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.js +1043 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/amd.js +15 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/gtr.js +173 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/index.js +584 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +174 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/no-module.js +19 -0
- data/vendor/node_modules/traceur/package.json +64 -0
- data/vendor/node_modules/traceur/src/node/System.js +31 -0
- data/vendor/node_modules/traceur/src/node/api.js +124 -0
- data/vendor/node_modules/traceur/src/node/command.js +141 -0
- data/vendor/node_modules/traceur/src/node/compile-single-file.js +69 -0
- data/vendor/node_modules/traceur/src/node/compiler.js +116 -0
- data/vendor/node_modules/traceur/src/node/deferred.js +110 -0
- data/vendor/node_modules/traceur/src/node/file-util.js +73 -0
- data/vendor/node_modules/traceur/src/node/getopt.js +147 -0
- data/vendor/node_modules/traceur/src/node/inline-module.js +149 -0
- data/vendor/node_modules/traceur/src/node/interpreter.js +33 -0
- data/vendor/node_modules/traceur/src/node/nodeLoader.js +41 -0
- data/vendor/node_modules/traceur/src/node/require.js +85 -0
- data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +33 -0
- data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +33 -0
- data/vendor/node_modules/traceur/src/node/traceur.js +32 -0
- data/vendor/node_modules/traceur/traceur +3 -0
- metadata +359 -0
@@ -0,0 +1,110 @@
|
|
1
|
+
/*global __dirname*/
|
2
|
+
require("../lib/jasmine-promise");
|
3
|
+
var Http = require("../../http");
|
4
|
+
var Apps = require("../../http-apps");
|
5
|
+
var FS = require("../../fs");
|
6
|
+
var Mock = require("../../fs-mock");
|
7
|
+
|
8
|
+
describe("FileTree followInsecureSymbolicLinks", function () {
|
9
|
+
var testApp;
|
10
|
+
function makeApp(followInsecureSymbolicLinks) {
|
11
|
+
var fixture = FS.join(module.directory || __dirname, "fixtures");
|
12
|
+
return FS.mock(fixture)
|
13
|
+
.then(function (mockFS) {
|
14
|
+
return FS.merge([ mockFS, Mock({ "6789/0123.txt": "0123\n" })]);
|
15
|
+
})
|
16
|
+
.then(function (mockFS) {
|
17
|
+
return mockFS.symbolicCopy("6789", FS.join("9012","linkedDir"), "directory").thenResolve(mockFS);
|
18
|
+
})
|
19
|
+
.then(function (mockFS) {
|
20
|
+
return mockFS.symbolicCopy( FS.join("6789","0123.txt"), FS.join("9012","linkedFile.txt"), "file").thenResolve(mockFS);
|
21
|
+
})
|
22
|
+
.then(function (mockFS) {
|
23
|
+
return new Apps.Chain()
|
24
|
+
.use(Apps.ListDirectories)
|
25
|
+
.use(function () {
|
26
|
+
return Apps.FileTree(FS.join("/","9012"), {fs: mockFS, followInsecureSymbolicLinks: followInsecureSymbolicLinks});
|
27
|
+
})
|
28
|
+
.end()
|
29
|
+
}).then(function (app) {
|
30
|
+
return Http.Server(app).listen(0)
|
31
|
+
});
|
32
|
+
};
|
33
|
+
|
34
|
+
describe("if false", function () {
|
35
|
+
beforeEach(function () {
|
36
|
+
testApp = makeApp(false)
|
37
|
+
});
|
38
|
+
it("should not follow symbolic links to directories", function () {
|
39
|
+
return testApp.then(function (server) {
|
40
|
+
var port = server.address().port;
|
41
|
+
return Http.read({
|
42
|
+
url: "http://127.0.0.1:" + port + "/linkedDir/",
|
43
|
+
headers: {
|
44
|
+
accept: "text/plain"
|
45
|
+
},
|
46
|
+
charset: 'utf-8'
|
47
|
+
})
|
48
|
+
.then(null, function (error) {
|
49
|
+
expect(error.response.status).toEqual(404);
|
50
|
+
})
|
51
|
+
.finally(server.stop);
|
52
|
+
});
|
53
|
+
});
|
54
|
+
it("should not follow symbolic links to files", function () {
|
55
|
+
return testApp.then(function (server) {
|
56
|
+
var port = server.address().port;
|
57
|
+
return Http.read({
|
58
|
+
url: "http://127.0.0.1:" + port + "/linkedFile.txt",
|
59
|
+
headers: {
|
60
|
+
accept: "text/plain"
|
61
|
+
},
|
62
|
+
charset: 'utf-8'
|
63
|
+
})
|
64
|
+
.then(null, function (error) {
|
65
|
+
expect(error.response.status).toEqual(404);
|
66
|
+
})
|
67
|
+
.finally(server.stop);
|
68
|
+
});
|
69
|
+
});
|
70
|
+
});
|
71
|
+
|
72
|
+
describe("if true", function () {
|
73
|
+
beforeEach(function () {
|
74
|
+
testApp = makeApp(true)
|
75
|
+
});
|
76
|
+
it("should follow symbolic links to directories", function () {
|
77
|
+
return testApp.then(function (server) {
|
78
|
+
var port = server.address().port;
|
79
|
+
return Http.read({
|
80
|
+
url: "http://127.0.0.1:" + port + "/linkedDir/",
|
81
|
+
headers: {
|
82
|
+
accept: "text/plain"
|
83
|
+
},
|
84
|
+
charset: 'utf-8'
|
85
|
+
})
|
86
|
+
.then(function (content) {
|
87
|
+
expect(content).toEqual("0123.txt\n");
|
88
|
+
})
|
89
|
+
.finally(server.stop);
|
90
|
+
});
|
91
|
+
});
|
92
|
+
it("should follow symbolic links to files", function () {
|
93
|
+
return testApp.then(function (server) {
|
94
|
+
var port = server.address().port;
|
95
|
+
return Http.read({
|
96
|
+
url: "http://127.0.0.1:" + port + "/linkedFile.txt",
|
97
|
+
headers: {
|
98
|
+
accept: "text/plain"
|
99
|
+
},
|
100
|
+
charset: 'utf-8'
|
101
|
+
})
|
102
|
+
.then(function (content) {
|
103
|
+
expect(content).toEqual("0123\n");
|
104
|
+
})
|
105
|
+
.finally(server.stop);
|
106
|
+
});
|
107
|
+
});
|
108
|
+
});
|
109
|
+
|
110
|
+
});
|
@@ -0,0 +1,96 @@
|
|
1
|
+
require("../lib/jasmine-promise");
|
2
|
+
var Q = require("q");
|
3
|
+
var HTTPS = require("https");
|
4
|
+
var http = require('../../http');
|
5
|
+
|
6
|
+
describe("https agent", function () {
|
7
|
+
|
8
|
+
it("should allow use self-signed certificate", function () {
|
9
|
+
var options = {
|
10
|
+
passphrase: 'q-io-https',
|
11
|
+
key: '-----BEGIN RSA PRIVATE KEY-----\n' +
|
12
|
+
'Proc-Type: 4,ENCRYPTED\n' +
|
13
|
+
'DEK-Info: DES-EDE3-CBC,6ACDE0E22CA24B54\n' +
|
14
|
+
'\n' +
|
15
|
+
'MHs2noP3Vm8SyHkZ/KaPv2tkwEQx3CZVFmaoTUakJsj/QT2itDWoEzRZaffmqJ5z\n' +
|
16
|
+
'tCYyXFhwfJinJVwkkOGU5Hv2n8hYNcsRucFC5Y+BUQKEuAtalq3YGoIWWggDPzqb\n' +
|
17
|
+
'xGEI46PZS+kt8wGcMau1ArSwv2GuY3P8yjV97uus8Mc+U7XazkAgtlLX95wu9cGL\n' +
|
18
|
+
'HrMUCll0SdCwwiQ+yOh/KPvLTOImq8l4h1EUi1EbLREvobpVvwWgwKPixKFSLg/3\n' +
|
19
|
+
'KM9WK8P7nuLoJlTTgwXjwOZRWGCaq/m8UkmeMGN3+OBjRnVOdwksvFJSRuHyy24F\n' +
|
20
|
+
'9DQHo3Lh+MRrlTq5byYFAYuom4yszxeTm6LS9iXlJNB2mrf1LHPvPlR86oXz8EoI\n' +
|
21
|
+
'/sgfYLOUUMtF5779dmeyUFeekW8w09uFt3BfcxWbh+AVraIHkH3iXHwvD5lrx2re\n' +
|
22
|
+
'MXP1PHZnzbhEkV01bRL0+keQuS3gd+q723iQnY6NqXPtnaQxBLt6Z0NLBAh6NbR5\n' +
|
23
|
+
'CsPRyDnNCYz2/i/3lxe2vGeVAGLgu5U2r8MvKXGMn6off+94jmLGWgWcnqlt/bfg\n' +
|
24
|
+
'Ob9hiZEjSAX+NOvnvhcT/J4NYnVoZPqodM+zvgSDMP1CGQ84k4Ubsnvv70wYvFbY\n' +
|
25
|
+
'CNqS/TpnK5uDE9vbwFyJhgOTXF+8PZJE3cRfOo9INIo39b9TTE7jPbgSF+k5V3Dd\n' +
|
26
|
+
'4t55Xt9GaJAHr3xVViNtOKssbXtnQ73P3dg4pTZkA4E0i0kYZhmR45qXL9989Pbm\n' +
|
27
|
+
'lNlirMIj8P4ysX2/MxT2KYcG6IBSHnAzx5raY0xSFUOeAB5q9GheqA==\n' +
|
28
|
+
'-----END RSA PRIVATE KEY-----\n',
|
29
|
+
cert: '-----BEGIN CERTIFICATE-----\n' +
|
30
|
+
'MIICsDCCAhmgAwIBAgIJANjH3x23QvNtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\n' +
|
31
|
+
'BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\n' +
|
32
|
+
'aWRnaXRzIFB0eSBMdGQwHhcNMTMwOTEyMDEyMjUzWhcNMjMwOTEwMDEyMjUzWjBF\n' +
|
33
|
+
'MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\n' +
|
34
|
+
'ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n' +
|
35
|
+
'gQDDPt+Ouup0iECslVxoA9mspIDVtgjph9bAuYmB84K3nz/CTA2E8mJhfDCFUk+v\n' +
|
36
|
+
'ipKvD+bnVgR8asql8AutHzaiCr6yOxUfs9gRgJ37TQGmTFpKx5/OegV2t7khq8Uc\n' +
|
37
|
+
'Wp7SChZuQ2CZrDjNeZl6K7CFtcbU6yV4tYKsNyNQslSyvwIDAQABo4GnMIGkMB0G\n' +
|
38
|
+
'A1UdDgQWBBTn1FqVoBznKu+Vtl5Bspq4PGwxEjB1BgNVHSMEbjBsgBTn1FqVoBzn\n' +
|
39
|
+
'Ku+Vtl5Bspq4PGwxEqFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUt\n' +
|
40
|
+
'U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJANjH3x23\n' +
|
41
|
+
'QvNtMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAMw8bTEPx+rlIxTMR\n' +
|
42
|
+
'rvZriPeMzlh45vhRyy7JO1C+RnzSVBWUyL/Ca7QbrFcq4nGai2xFnqEEiPKWrP8b\n' +
|
43
|
+
've1oBz9V18gv6T4oiqOpFmoh2c/IVNr2qE01GdGIos/wb1cYEFRsMLPplbv4PROR\n' +
|
44
|
+
'89Yb8/2e/5CzxW4LAMNRqD5GwKE=\n' +
|
45
|
+
'-----END CERTIFICATE-----\n'
|
46
|
+
};
|
47
|
+
|
48
|
+
var server = HTTPS.createServer(options, function (req, res) {
|
49
|
+
res.writeHead(200, {
|
50
|
+
'Content-Type': 'text/plain',
|
51
|
+
'Content-Length': 2
|
52
|
+
});
|
53
|
+
res.end('ok');
|
54
|
+
});
|
55
|
+
|
56
|
+
server.listen(0);
|
57
|
+
|
58
|
+
var port = server.address().port;
|
59
|
+
|
60
|
+
var allow = http.request({
|
61
|
+
"host": "localhost",
|
62
|
+
"port": port,
|
63
|
+
"ssl": true,
|
64
|
+
"agent": new HTTPS.Agent({
|
65
|
+
rejectUnauthorized: false
|
66
|
+
})
|
67
|
+
})
|
68
|
+
.then(function (response) {
|
69
|
+
expect(Q.isPromise(response.body)).toBe(false);
|
70
|
+
return response.body.read()
|
71
|
+
.then(function (body) {
|
72
|
+
expect(body.toString("utf-8")).toBe("ok");
|
73
|
+
});
|
74
|
+
});
|
75
|
+
|
76
|
+
var reject = http.request({
|
77
|
+
host: "localhost",
|
78
|
+
port: port,
|
79
|
+
ssl: true,
|
80
|
+
agent: new HTTPS.Agent({
|
81
|
+
rejectUnauthorized: true
|
82
|
+
})
|
83
|
+
}).then(function (response) {
|
84
|
+
// should not be here
|
85
|
+
expect(response).toBeUndefined();
|
86
|
+
}).fail(function(err) {
|
87
|
+
expect(Q.isPromise(err)).toBe(false);
|
88
|
+
expect(err).toEqual(jasmine.any(Error));
|
89
|
+
expect(err.message).toBe('DEPTH_ZERO_SELF_SIGNED_CERT');
|
90
|
+
});
|
91
|
+
|
92
|
+
return Q.all([allow, reject]).finally(function () {
|
93
|
+
server.close();
|
94
|
+
});
|
95
|
+
});
|
96
|
+
});
|
@@ -0,0 +1,96 @@
|
|
1
|
+
|
2
|
+
require("../lib/jasmine-promise");
|
3
|
+
var Q = require("q");
|
4
|
+
var HTTP = require("../../http");
|
5
|
+
|
6
|
+
describe("http server and client", function () {
|
7
|
+
|
8
|
+
it("should work as both server and client", function () {
|
9
|
+
var response = {
|
10
|
+
"status": 200,
|
11
|
+
"headers": {
|
12
|
+
"content-type": "text/plain"
|
13
|
+
},
|
14
|
+
"body": [
|
15
|
+
"Hello, World!"
|
16
|
+
]
|
17
|
+
};
|
18
|
+
|
19
|
+
var server = HTTP.Server(function () {
|
20
|
+
return response;
|
21
|
+
});
|
22
|
+
|
23
|
+
return server.listen(0)
|
24
|
+
.then(function (server) {
|
25
|
+
var port = server.address().port;
|
26
|
+
|
27
|
+
var request = {
|
28
|
+
"host": "localhost",
|
29
|
+
"port": port,
|
30
|
+
"headers": {
|
31
|
+
"host": "localhost"
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
return HTTP.request(request)
|
36
|
+
.then(function (response) {
|
37
|
+
expect(Q.isPromise(response.body)).toBe(false);
|
38
|
+
var acc = [];
|
39
|
+
return response.body.read()
|
40
|
+
.then(function (body) {
|
41
|
+
expect(body.toString("utf-8")).toBe("Hello, World!");
|
42
|
+
});
|
43
|
+
})
|
44
|
+
})
|
45
|
+
.finally(server.stop)
|
46
|
+
});
|
47
|
+
|
48
|
+
it("should defer a response", function () {
|
49
|
+
var response = {
|
50
|
+
"status": 200,
|
51
|
+
"headers": {
|
52
|
+
"content-type": "text/plain; charset=utf-8"
|
53
|
+
},
|
54
|
+
"body": {
|
55
|
+
"forEach": function (write) {
|
56
|
+
var deferred = Q.defer();
|
57
|
+
write("Hello, World!");
|
58
|
+
setTimeout(function () {
|
59
|
+
deferred.resolve();
|
60
|
+
}, 100);
|
61
|
+
return deferred.promise;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
};
|
65
|
+
|
66
|
+
var server = HTTP.Server(function () {
|
67
|
+
return response;
|
68
|
+
});
|
69
|
+
|
70
|
+
return server.listen(0).then(function (server) {
|
71
|
+
var port = server.node.address().port;
|
72
|
+
|
73
|
+
var request = {
|
74
|
+
"host": "localhost",
|
75
|
+
"port": port,
|
76
|
+
"headers": {
|
77
|
+
"host": "localhost"
|
78
|
+
},
|
79
|
+
"charset": "utf-8"
|
80
|
+
};
|
81
|
+
|
82
|
+
return HTTP.request(request)
|
83
|
+
.then(function (response) {
|
84
|
+
var acc = [];
|
85
|
+
return response.body.read()
|
86
|
+
.then(function (body) {
|
87
|
+
expect(body).toBe("Hello, World!");
|
88
|
+
});
|
89
|
+
})
|
90
|
+
})
|
91
|
+
.finally(server.stop)
|
92
|
+
});
|
93
|
+
|
94
|
+
|
95
|
+
});
|
96
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var Q = require("q");
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Modifies the way that individual specs are run to easily test async
|
7
|
+
* code with promises.
|
8
|
+
*
|
9
|
+
* A spec may return a promise. If it does, then the spec passes if and
|
10
|
+
* only if that promise is fulfilled within a very short period of time.
|
11
|
+
* If it is rejected, or if it isn't fulfilled quickly, the spec fails.
|
12
|
+
*
|
13
|
+
* In this way, we can use promise chaining to structure our asynchronous
|
14
|
+
* tests. Expectations all down the chain of promises are all checked and
|
15
|
+
* guaranteed to be run and resolved or the test fails.
|
16
|
+
*
|
17
|
+
* This is a big win over the runs() and watches() code that jasmine
|
18
|
+
* supports out of the box.
|
19
|
+
*/
|
20
|
+
jasmine.Block.prototype.execute = function (onComplete) {
|
21
|
+
var spec = this.spec;
|
22
|
+
try {
|
23
|
+
var result = this.func.call(spec, onComplete);
|
24
|
+
|
25
|
+
// It seems Jasmine likes to return the suite if you pass it anything.
|
26
|
+
// So make sure it's a promise first.
|
27
|
+
if (result && typeof result.then === "function") {
|
28
|
+
Q.timeout(result, 500).then(function () {
|
29
|
+
onComplete();
|
30
|
+
}, function (error) {
|
31
|
+
spec.fail(error);
|
32
|
+
onComplete();
|
33
|
+
});
|
34
|
+
} else if (this.func.length === 0) {
|
35
|
+
onComplete();
|
36
|
+
}
|
37
|
+
} catch (error) {
|
38
|
+
spec.fail(error);
|
39
|
+
onComplete();
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
@@ -0,0 +1,111 @@
|
|
1
|
+
|
2
|
+
var Q = require("q");
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Wraps a Node writable stream, providing an API similar to
|
6
|
+
* Narwhal's synchronous `io` streams, except returning and
|
7
|
+
* accepting promises for long-latency operations.
|
8
|
+
*
|
9
|
+
* @param stream any Node writable stream
|
10
|
+
* @returns {Promise * Writer} a promise for the
|
11
|
+
* text writer.
|
12
|
+
*/
|
13
|
+
module.exports = Writer;
|
14
|
+
|
15
|
+
var version = process.versions.node.split('.');
|
16
|
+
var supportsFinish = version[0] >= 0 && version[1] >= 10;
|
17
|
+
|
18
|
+
function Writer(_stream, charset) {
|
19
|
+
var self = Object.create(Writer.prototype);
|
20
|
+
|
21
|
+
if (charset && _stream.setEncoding) // TODO complain about inconsistency
|
22
|
+
_stream.setEncoding(charset);
|
23
|
+
|
24
|
+
var drained = Q.defer();
|
25
|
+
|
26
|
+
_stream.on("error", function (reason) {
|
27
|
+
drained.reject(reason);
|
28
|
+
drained = Q.defer();
|
29
|
+
});
|
30
|
+
|
31
|
+
_stream.on("drain", function () {
|
32
|
+
drained.resolve();
|
33
|
+
drained = Q.defer();
|
34
|
+
});
|
35
|
+
|
36
|
+
/***
|
37
|
+
* Writes content to the stream.
|
38
|
+
* @param {String} content
|
39
|
+
* @returns {Promise * Undefined} a promise that will
|
40
|
+
* be resolved when the buffer is empty, meaning
|
41
|
+
* that all of the content has been sent.
|
42
|
+
*/
|
43
|
+
self.write = function (content) {
|
44
|
+
if (!_stream.writeable && !_stream.writable)
|
45
|
+
return Q.reject(new Error("Can't write to non-writable (possibly closed) stream"));
|
46
|
+
if (typeof content !== "string") {
|
47
|
+
content = new Buffer(content);
|
48
|
+
}
|
49
|
+
if (!_stream.write(content)) {
|
50
|
+
return drained.promise;
|
51
|
+
} else {
|
52
|
+
return Q.resolve();
|
53
|
+
}
|
54
|
+
};
|
55
|
+
|
56
|
+
/***
|
57
|
+
* Waits for all data to flush on the stream.
|
58
|
+
*
|
59
|
+
* @returns {Promise * Undefined} a promise that will
|
60
|
+
* be resolved when the buffer is empty
|
61
|
+
*/
|
62
|
+
self.flush = function () {
|
63
|
+
return drained.promise;
|
64
|
+
};
|
65
|
+
|
66
|
+
/***
|
67
|
+
* Closes the stream, waiting for the internal buffer
|
68
|
+
* to flush.
|
69
|
+
*
|
70
|
+
* @returns {Promise * Undefined} a promise that will
|
71
|
+
* be resolved when the stream has finished writing,
|
72
|
+
* flushing, and closed.
|
73
|
+
*/
|
74
|
+
self.close = function () {
|
75
|
+
var finished;
|
76
|
+
|
77
|
+
if (supportsFinish) { // new Streams, listen for `finish` event
|
78
|
+
finished = Q.defer();
|
79
|
+
_stream.on("finish", function () {
|
80
|
+
finished.resolve();
|
81
|
+
});
|
82
|
+
_stream.on("error", function (reason) {
|
83
|
+
finished.reject(reason);
|
84
|
+
});
|
85
|
+
}
|
86
|
+
|
87
|
+
_stream.end();
|
88
|
+
drained.resolve(); // we will get no further drain events
|
89
|
+
if (finished) { // closing not explicitly observable
|
90
|
+
return finished.promise;
|
91
|
+
} else {
|
92
|
+
return Q(); // just resolve for old Streams
|
93
|
+
}
|
94
|
+
};
|
95
|
+
|
96
|
+
/***
|
97
|
+
* Terminates writing on a stream, closing before
|
98
|
+
* the internal buffer drains.
|
99
|
+
*
|
100
|
+
* @returns {Promise * Undefined} a promise that will
|
101
|
+
* be resolved when the stream has finished closing.
|
102
|
+
*/
|
103
|
+
self.destroy = function () {
|
104
|
+
_stream.destroy();
|
105
|
+
drained.resolve(); // we will get no further drain events
|
106
|
+
return Q.resolve(); // destruction not explicitly observable
|
107
|
+
};
|
108
|
+
|
109
|
+
return Q(self); // todo returns the begin.promise
|
110
|
+
}
|
111
|
+
|