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,105 @@
|
|
1
|
+
|
2
|
+
var Q = require("q");
|
3
|
+
var BOOT = require("./fs-boot");
|
4
|
+
var COMMON = require("./fs-common");
|
5
|
+
|
6
|
+
module.exports = RootFs;
|
7
|
+
|
8
|
+
function RootFs(outer, root) {
|
9
|
+
var inner = Object.create(BOOT);
|
10
|
+
|
11
|
+
function attenuate(path) {
|
12
|
+
|
13
|
+
// the machinations of projecting a path inside a
|
14
|
+
// subroot
|
15
|
+
var actual;
|
16
|
+
// if it's absolute, we want the path relative to
|
17
|
+
// the root of the inner file system
|
18
|
+
if (outer.isAbsolute(path)) {
|
19
|
+
actual = outer.relativeFromDirectory(outer.ROOT, path);
|
20
|
+
} else {
|
21
|
+
actual = path;
|
22
|
+
}
|
23
|
+
// we join the path onto the root of the inner file
|
24
|
+
// system so that parent references from the root
|
25
|
+
// return to the root, emulating standard unix
|
26
|
+
// behavior
|
27
|
+
actual = outer.join(outer.ROOT, actual);
|
28
|
+
// then we reconstruct the path relative to the
|
29
|
+
// inner root
|
30
|
+
actual = outer.relativeFromDirectory(outer.ROOT, actual);
|
31
|
+
// and rejoin it on the outer root
|
32
|
+
actual = outer.join(root, actual);
|
33
|
+
// and find the corresponding real path
|
34
|
+
return outer.canonical(actual)
|
35
|
+
.then(function (actual) {
|
36
|
+
return actual;
|
37
|
+
}, function () {
|
38
|
+
return actual;
|
39
|
+
}).then(function (actual) {
|
40
|
+
// and verify that the outer canonical path is
|
41
|
+
// actually inside the inner canonical path, to
|
42
|
+
// prevent break-outs
|
43
|
+
if (outer.contains(root, actual)) {
|
44
|
+
return {
|
45
|
+
"inner": outer.join(outer.ROOT, outer.relativeFromDirectory(root, actual)),
|
46
|
+
"outer": actual
|
47
|
+
};
|
48
|
+
} else {
|
49
|
+
return Q.reject("Can't find: " + JSON.stringify(path));
|
50
|
+
}
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
function workingDirectory() {
|
55
|
+
return outer.ROOT;
|
56
|
+
}
|
57
|
+
|
58
|
+
COMMON.update(inner, workingDirectory);
|
59
|
+
|
60
|
+
inner.list = function (path) {
|
61
|
+
return attenuate(path).then(function (path) {
|
62
|
+
return outer.list(path.outer);
|
63
|
+
}).then(null, function (reason) {
|
64
|
+
return Q.reject("Can't list " + JSON.stringify(path));
|
65
|
+
});
|
66
|
+
};
|
67
|
+
|
68
|
+
inner.open = function (path, flags, charset) {
|
69
|
+
return attenuate(path).then(function (path) {
|
70
|
+
return outer.open(path.outer, flags, charset);
|
71
|
+
}).then(null, function (reason) {
|
72
|
+
return Q.reject("Can't open " + JSON.stringify(path));
|
73
|
+
});
|
74
|
+
};
|
75
|
+
|
76
|
+
inner.stat = function (path) {
|
77
|
+
return attenuate(path).then(function (path) {
|
78
|
+
return outer.stat(path.outer);
|
79
|
+
}).then(null, function (reason) {
|
80
|
+
return Q.reject("Can't stat " + JSON.stringify(path));
|
81
|
+
});
|
82
|
+
};
|
83
|
+
|
84
|
+
inner.canonical = function (path) {
|
85
|
+
return attenuate(path).then(function (path) {
|
86
|
+
return path.inner;
|
87
|
+
}).then(null, function (reason) {
|
88
|
+
return Q.reject("Can't find canonical of " + JSON.stringify(path));
|
89
|
+
});
|
90
|
+
};
|
91
|
+
|
92
|
+
inner.makeDirectory = function (path) {
|
93
|
+
return attenuate(path).then(function (path) {
|
94
|
+
return outer.makeDirectory(path.outer);
|
95
|
+
}).catch(function (error) {
|
96
|
+
throw new Error("Can't make directory " + JSON.stringify(path));
|
97
|
+
});
|
98
|
+
};
|
99
|
+
|
100
|
+
return Q.when(outer.canonical(root), function (_root) {
|
101
|
+
root = _root;
|
102
|
+
return inner;
|
103
|
+
});
|
104
|
+
}
|
105
|
+
|
@@ -0,0 +1,355 @@
|
|
1
|
+
/**
|
2
|
+
* An asynchronous local file system API, based on a subset
|
3
|
+
* of the `narwhal/fs` API and the `narwhal/promise` API,
|
4
|
+
* such that the method names are the same but some return
|
5
|
+
* values are promises instead of fully resolved values.
|
6
|
+
* @module
|
7
|
+
*/
|
8
|
+
|
9
|
+
/*whatsupdoc*/
|
10
|
+
|
11
|
+
var FS = require("fs"); // node
|
12
|
+
var Q = require("q");
|
13
|
+
var Reader = require("./reader");
|
14
|
+
var Writer = require("./writer");
|
15
|
+
var Common = require("./fs-common");
|
16
|
+
var Mock = require("./fs-mock");
|
17
|
+
var Root = require("./fs-root");
|
18
|
+
|
19
|
+
Common.update(exports, process.cwd);
|
20
|
+
exports.Mock = Mock;
|
21
|
+
exports.Root = Root;
|
22
|
+
|
23
|
+
// facilitates AIMD (additive increase, multiplicative decrease) for backing off
|
24
|
+
var backOffDelay = 0;
|
25
|
+
var backOffFactor = 1.0001;
|
26
|
+
function dampen(wrapped, thisp) {
|
27
|
+
var retry = function () {
|
28
|
+
var args = arguments;
|
29
|
+
var ready = backOffDelay ? Q.delay(backOffDelay) : Q.resolve();
|
30
|
+
return ready.then(function () {
|
31
|
+
return Q.when(wrapped.apply(thisp, args), function (stream) {
|
32
|
+
backOffDelay = Math.max(0, backOffDelay - 1);
|
33
|
+
return stream;
|
34
|
+
}, function (error) {
|
35
|
+
if (error.code === "EMFILE") {
|
36
|
+
backOffDelay = (backOffDelay + 1) * backOffFactor;
|
37
|
+
return retry.apply(null, args);
|
38
|
+
} else {
|
39
|
+
throw error;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
};
|
44
|
+
return retry;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @param {String} path
|
49
|
+
* @param {Object} options (flags, mode, bufferSize, charset, begin, end)
|
50
|
+
* @returns {Promise * Stream} a stream from the `q-io` module.
|
51
|
+
*/
|
52
|
+
exports.open = dampen(function (path, flags, charset, options) {
|
53
|
+
var self = this;
|
54
|
+
if (typeof flags == "object") {
|
55
|
+
options = flags;
|
56
|
+
flags = options.flags;
|
57
|
+
charset = options.charset;
|
58
|
+
}
|
59
|
+
options = options || {};
|
60
|
+
flags = flags || "r";
|
61
|
+
var nodeFlags = flags.replace(/b/g, "") || "r";
|
62
|
+
var nodeOptions = {
|
63
|
+
"flags": nodeFlags
|
64
|
+
};
|
65
|
+
if ("bufferSize" in options) {
|
66
|
+
nodeOptions.bufferSize = options.bufferSize;
|
67
|
+
}
|
68
|
+
if ("mode" in options) {
|
69
|
+
nodeOptions.mode = options.mode;
|
70
|
+
}
|
71
|
+
if ("begin" in options) {
|
72
|
+
nodeOptions.start = options.begin;
|
73
|
+
nodeOptions.end = options.end - 1;
|
74
|
+
}
|
75
|
+
if (flags.indexOf("b") >= 0) {
|
76
|
+
if (charset) {
|
77
|
+
throw new Error("Can't open a binary file with a charset: " + charset);
|
78
|
+
}
|
79
|
+
} else {
|
80
|
+
charset = charset || 'utf-8';
|
81
|
+
}
|
82
|
+
if (flags.indexOf("w") >= 0 || flags.indexOf("a") >= 0) {
|
83
|
+
var stream = FS.createWriteStream(String(path), nodeOptions);
|
84
|
+
return Writer(stream, charset);
|
85
|
+
} else {
|
86
|
+
var stream = FS.createReadStream(String(path), nodeOptions);
|
87
|
+
return Reader(stream, charset);
|
88
|
+
}
|
89
|
+
});
|
90
|
+
|
91
|
+
exports.remove = function (path) {
|
92
|
+
path = String(path);
|
93
|
+
var done = Q.defer();
|
94
|
+
FS.unlink(path, function (error) {
|
95
|
+
if (error) {
|
96
|
+
error.message = "Can't remove " + JSON.stringify(path) + ": " + error.message;
|
97
|
+
done.reject(error);
|
98
|
+
} else {
|
99
|
+
done.resolve();
|
100
|
+
}
|
101
|
+
});
|
102
|
+
return done.promise;
|
103
|
+
};
|
104
|
+
|
105
|
+
exports.rename = function (source, target) {
|
106
|
+
source = String(source);
|
107
|
+
target = String(target);
|
108
|
+
return Q.ninvoke(FS, "rename", source, target)
|
109
|
+
.fail(function (error) {
|
110
|
+
if (error.code === "EXDEV") {
|
111
|
+
error.message = "source and target are on different devices: " + error.message;
|
112
|
+
error.crossDevice = true;
|
113
|
+
}
|
114
|
+
error.message = (
|
115
|
+
"Can't move " + JSON.stringify(source) + " to " +
|
116
|
+
JSON.stringify(target) + " because " + error.message
|
117
|
+
);
|
118
|
+
throw error;
|
119
|
+
});
|
120
|
+
};
|
121
|
+
|
122
|
+
exports.makeDirectory = function (path, mode) {
|
123
|
+
path = String(path);
|
124
|
+
var done = Q.defer();
|
125
|
+
if (typeof mode === "string") {
|
126
|
+
mode = parseInt(mode, 8);
|
127
|
+
} else if (mode === void 0) {
|
128
|
+
mode = parseInt('755', 8);
|
129
|
+
}
|
130
|
+
FS.mkdir(path, mode, function (error) {
|
131
|
+
if (error) {
|
132
|
+
if (error.code === "EISDIR") {
|
133
|
+
error.exists = true;
|
134
|
+
error.isDirectory = true;
|
135
|
+
error.message = "directory already exists: " + error.message;
|
136
|
+
}
|
137
|
+
if (error.code === "EEXIST") {
|
138
|
+
error.exists = true;
|
139
|
+
error.message = "file exists at that path: " + error.message;
|
140
|
+
}
|
141
|
+
error.message = "Can't makeDirectory " + JSON.stringify(path) + " with mode " + mode + ": " + error.message;
|
142
|
+
done.reject(error);
|
143
|
+
} else {
|
144
|
+
done.resolve();
|
145
|
+
}
|
146
|
+
});
|
147
|
+
return done.promise;
|
148
|
+
};
|
149
|
+
|
150
|
+
exports.removeDirectory = function (path) {
|
151
|
+
path = String(path);
|
152
|
+
var done = Q.defer();
|
153
|
+
FS.rmdir(path, function (error) {
|
154
|
+
if (error) {
|
155
|
+
error.message = "Can't removeDirectory " + JSON.stringify(path) + ": " + error.message;
|
156
|
+
done.reject(error);
|
157
|
+
} else {
|
158
|
+
done.resolve();
|
159
|
+
}
|
160
|
+
});
|
161
|
+
return done.promise;
|
162
|
+
};
|
163
|
+
|
164
|
+
/**
|
165
|
+
*/
|
166
|
+
exports.list = dampen(function (path) {
|
167
|
+
path = String(path);
|
168
|
+
var result = Q.defer();
|
169
|
+
FS.readdir(path, function (error, list) {
|
170
|
+
if (error) {
|
171
|
+
error.message = "Can't list " + JSON.stringify(path) + ": " + error.message;
|
172
|
+
return result.reject(error);
|
173
|
+
} else {
|
174
|
+
result.resolve(list);
|
175
|
+
}
|
176
|
+
});
|
177
|
+
return result.promise;
|
178
|
+
});
|
179
|
+
|
180
|
+
/**
|
181
|
+
* @param {String} path
|
182
|
+
* @returns {Promise * Stat}
|
183
|
+
*/
|
184
|
+
exports.stat = function (path) {
|
185
|
+
var self = this;
|
186
|
+
path = String(path);
|
187
|
+
var done = Q.defer();
|
188
|
+
try {
|
189
|
+
FS.stat(path, function (error, stat) {
|
190
|
+
if (error) {
|
191
|
+
error.message = "Can't stat " + JSON.stringify(path) + ": " + error;
|
192
|
+
done.reject(error);
|
193
|
+
} else {
|
194
|
+
done.resolve(new self.Stats(stat));
|
195
|
+
}
|
196
|
+
});
|
197
|
+
} catch (error) {
|
198
|
+
done.reject(error);
|
199
|
+
}
|
200
|
+
return done.promise;
|
201
|
+
};
|
202
|
+
|
203
|
+
exports.statLink = function (path) {
|
204
|
+
path = String(path);
|
205
|
+
var done = Q.defer();
|
206
|
+
try {
|
207
|
+
FS.lstat(path, function (error, stat) {
|
208
|
+
if (error) {
|
209
|
+
error.message = "Can't statLink " + JSON.stringify(path) + ": " + error.message;
|
210
|
+
done.reject(error);
|
211
|
+
} else {
|
212
|
+
done.resolve(stat);
|
213
|
+
}
|
214
|
+
});
|
215
|
+
} catch (error) {
|
216
|
+
done.reject(error);
|
217
|
+
}
|
218
|
+
return done.promise;
|
219
|
+
};
|
220
|
+
|
221
|
+
exports.statFd = function (fd) {
|
222
|
+
fd = Number(fd);
|
223
|
+
var done = Q.defer();
|
224
|
+
try {
|
225
|
+
FS.fstat(fd, function (error, stat) {
|
226
|
+
if (error) {
|
227
|
+
error.message = "Can't statFd file descriptor " + JSON.stringify(fd) + ": " + error.message;
|
228
|
+
done.reject(error);
|
229
|
+
} else {
|
230
|
+
done.resolve(stat);
|
231
|
+
}
|
232
|
+
});
|
233
|
+
} catch (error) {
|
234
|
+
done.reject(error);
|
235
|
+
}
|
236
|
+
return done.promise;
|
237
|
+
};
|
238
|
+
|
239
|
+
exports.link = function (source, target) {
|
240
|
+
source = String(source);
|
241
|
+
target = String(target);
|
242
|
+
var done = Q.defer();
|
243
|
+
try {
|
244
|
+
FS.link(source, target, function (error) {
|
245
|
+
if (error) {
|
246
|
+
error.message = "Can't link " + JSON.stringify(source) + " to " + JSON.stringify(target) + ": " + error.message;
|
247
|
+
done.reject(error);
|
248
|
+
} else {
|
249
|
+
done.resolve();
|
250
|
+
}
|
251
|
+
});
|
252
|
+
} catch (error) {
|
253
|
+
done.reject(error);
|
254
|
+
}
|
255
|
+
return done.promise;
|
256
|
+
};
|
257
|
+
|
258
|
+
// this lookup table translates the link types that Q-IO accepts (which have
|
259
|
+
// been normalized to full words to be consistent with the naming convention)
|
260
|
+
var linkTypes = {
|
261
|
+
"file": "file",
|
262
|
+
"directory": "dir",
|
263
|
+
"junction": "junction"
|
264
|
+
};
|
265
|
+
|
266
|
+
exports.symbolicLink = function (target, relative, type) {
|
267
|
+
if (!linkTypes.hasOwnProperty(type)) {
|
268
|
+
console.warn(new Error("For Windows compatibility, symbolicLink must be called with a type argument \"file\", \"directory\", or \"junction\""));
|
269
|
+
}
|
270
|
+
type = linkTypes[type];
|
271
|
+
target = String(target);
|
272
|
+
relative = String(relative);
|
273
|
+
var done = Q.defer();
|
274
|
+
try {
|
275
|
+
FS.symlink(relative, target, type || 'file', function (error) {
|
276
|
+
if (error) {
|
277
|
+
error.message = "Can't create symbolicLink " + JSON.stringify(target) + " to relative location " + JSON.stringify(relative) + ": " + error.message;
|
278
|
+
done.reject(error);
|
279
|
+
} else {
|
280
|
+
done.resolve();
|
281
|
+
}
|
282
|
+
});
|
283
|
+
} catch (error) {
|
284
|
+
done.reject(error);
|
285
|
+
}
|
286
|
+
return done.promise;
|
287
|
+
};
|
288
|
+
|
289
|
+
exports.chown = function (path, uid, gid) {
|
290
|
+
path = String(path);
|
291
|
+
var done = Q.defer();
|
292
|
+
try {
|
293
|
+
FS.chown(path, uid, gid, function (error) {
|
294
|
+
if (error) {
|
295
|
+
error.message = "Can't chown (change owner) of " + JSON.stringify(path) + " to user " + JSON.stringify(uid) + " and group " + JSON.stringify(gid) + ": " + error.message;
|
296
|
+
done.reject(error);
|
297
|
+
} else {
|
298
|
+
done.resolve();
|
299
|
+
}
|
300
|
+
});
|
301
|
+
} catch (error) {
|
302
|
+
done.reject(error);
|
303
|
+
}
|
304
|
+
return done.promise;
|
305
|
+
};
|
306
|
+
|
307
|
+
exports.chmod = function (path, mode) {
|
308
|
+
path = String(path);
|
309
|
+
mode = String(mode);
|
310
|
+
var done = Q.defer();
|
311
|
+
try {
|
312
|
+
FS.chmod(path, mode, function (error) {
|
313
|
+
if (error) {
|
314
|
+
error.message = "Can't chmod (change permissions mode) of " + JSON.stringify(path) + " to (octal number) " + mode.toString(8) + ": " + error.message;
|
315
|
+
done.reject(error);
|
316
|
+
} else {
|
317
|
+
done.resolve();
|
318
|
+
}
|
319
|
+
});
|
320
|
+
} catch (error) {
|
321
|
+
done.reject(error);
|
322
|
+
}
|
323
|
+
return done.promise;
|
324
|
+
};
|
325
|
+
|
326
|
+
exports.canonical = function (path) {
|
327
|
+
var result = Q.defer();
|
328
|
+
FS.realpath(path, function (error, canonicalPath) {
|
329
|
+
if (error) {
|
330
|
+
error.message = "Can't get canonical path of " + JSON.stringify(path) + " by way of C realpath: " + error.message;
|
331
|
+
result.reject(error);
|
332
|
+
} else {
|
333
|
+
result.resolve(canonicalPath);
|
334
|
+
}
|
335
|
+
});
|
336
|
+
return result.promise;
|
337
|
+
};
|
338
|
+
|
339
|
+
exports.readLink = function (path) {
|
340
|
+
var result = Q.defer();
|
341
|
+
FS.readlink(path, function (error, path) {
|
342
|
+
if (error) {
|
343
|
+
error.message = "Can't get link from " + JSON.stringify(path) + " by way of C readlink: " + error.message;
|
344
|
+
result.reject(error);
|
345
|
+
} else {
|
346
|
+
result.resolve(path);
|
347
|
+
}
|
348
|
+
});
|
349
|
+
return result.promise;
|
350
|
+
};
|
351
|
+
|
352
|
+
exports.mock = function (path) {
|
353
|
+
return Mock.mock(this, path);
|
354
|
+
};
|
355
|
+
|