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
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MDdiZWFhN2Q5NjZiMTYyMTgyN2I5NWM5YzUyYjcxNTk2NDBiOWMwMQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzZiOTQ3NmY0NTRlMjczN2I0NzdmMGIwNWUwZTljYmE5OTk1MTBlMA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZDM3NjcwZmE1MWViOTg0NzU2YzJiYzA3NzI4OWEzMzg2ZDljZmI0YzQyNTQ4
|
10
|
+
ZjdmMjg3MTAxYzI5MjUyMWFhZmVlODkxZTI5MDg2ZjViMWQ1MTM3MTEwN2Vj
|
11
|
+
MDgzZGMxMDkxNTBkZjFhZGIzNjRiMzljNDBlYjI0NzZkMGNiMjc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODI2NzJkN2VkNWJjNDdmMzhjN2FiZGM0YWUwNmRhOGIyY2FmMGNlYzcxZjI5
|
14
|
+
NzJjODRhZTI1ZTI2NjE0YjQ5YTEzZGQ1MTkzOGM0ZWZiMjk3NjYyZDE2NTBl
|
15
|
+
MDc2ZWZkYzk4N2M1Njg2NDA1ZjcxYWRlODAxNjMwNDUzZTUzYmU=
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
traceur
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3
|
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Adam Pohorecki
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
# traceur-rb
|
2
|
+
|
3
|
+
This gem provides a Ruby wrapper around [Google Traceur][gtraceur].
|
4
|
+
|
5
|
+
## Google Traceur
|
6
|
+
|
7
|
+
Google Traceur is a transpiler, which allows you to compile ECMAScript 6 (JS.next) features in today's browsers.
|
8
|
+
|
9
|
+
## Dependencies
|
10
|
+
|
11
|
+
Google Traceur depends on Node.js. On Ubuntu, you can install Node.js with command:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
sudo apt-get install node
|
15
|
+
```
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
Add this line to your application's Gemfile:
|
20
|
+
|
21
|
+
gem 'traceur-rb'
|
22
|
+
|
23
|
+
And then execute:
|
24
|
+
|
25
|
+
$ bundle
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
$ gem install traceur-rb
|
30
|
+
|
31
|
+
## Basic Usage
|
32
|
+
|
33
|
+
You can compile a snippet of ECMAScript 6 by calling the following method:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require 'traceur'
|
37
|
+
|
38
|
+
compiled_source = Traceur.compile(es6_source, additional_compilation_flags)
|
39
|
+
```
|
40
|
+
|
41
|
+
simmilarly, you can compile a file using:
|
42
|
+
|
43
|
+
```
|
44
|
+
require 'traceur'
|
45
|
+
|
46
|
+
compiled_source = Traceur.compile_file(path_to_es6_file, additional_compilation_flags)
|
47
|
+
```
|
48
|
+
|
49
|
+
## Configuration
|
50
|
+
|
51
|
+
traceur-rb can be configured using a `Traceur.configure`:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
Traceur.configure do |c|
|
55
|
+
# Configure path of the node.js binary.
|
56
|
+
# By default, traceur-rb loooks for node in $PATH.
|
57
|
+
c.node_binary = "/path/to/node"
|
58
|
+
|
59
|
+
# Configure path of node_modules folder, where
|
60
|
+
# traceur is installed.
|
61
|
+
# By default, traceur-rb uses traceur version
|
62
|
+
# which comes bundled with the gem.
|
63
|
+
c.node_modules_path = "/path/to/node_modules/"
|
64
|
+
|
65
|
+
# Configure path to traceur-runtime.js, which is
|
66
|
+
# a runtime dependency of the code compiled using
|
67
|
+
# Google Traceur.
|
68
|
+
# By default, this is computed based on node_modules_path.
|
69
|
+
c.traceur_runtime_path = "/path/to/node_modules/traceur/bin/traceur-runtime.js"
|
70
|
+
|
71
|
+
# Configure the default compilation options.
|
72
|
+
# For a complete list of options available, see:
|
73
|
+
# https://github.com/google/traceur-compiler/wiki/Options-for-Compiling
|
74
|
+
c.default_compilation_options.modules = :amd
|
75
|
+
c.default_compilation_options.source_map = true
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
## Contributing
|
80
|
+
|
81
|
+
1. Fork it ( https://github.com/[my-github-username]/traceur-rb/fork )
|
82
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
83
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
84
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
85
|
+
5. Create a new Pull Request
|
86
|
+
|
87
|
+
[gtraceur]: https://github.com/google/traceur-compiler
|
data/Rakefile
ADDED
data/lib/js/compile.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
var traceur = require('traceur');
|
2
|
+
var fs = require('fs');
|
3
|
+
|
4
|
+
if (process.argv.length < 5) {
|
5
|
+
throw "Usage: compile.js infile outfile options_as_json";
|
6
|
+
}
|
7
|
+
|
8
|
+
var infile = process.argv[2];
|
9
|
+
var outfile = process.argv[3];
|
10
|
+
var customOptions = JSON.parse(process.argv[4]);
|
11
|
+
|
12
|
+
var contents = fs.readFileSync(infile).toString();
|
13
|
+
|
14
|
+
var options = {
|
15
|
+
filename: infile
|
16
|
+
};
|
17
|
+
|
18
|
+
for (var key in customOptions) {
|
19
|
+
if (customOptions.hasOwnProperty(key)) {
|
20
|
+
options[key] = customOptions[key];
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
var result = traceur.compile(contents, options);
|
25
|
+
|
26
|
+
if (result.error) {
|
27
|
+
throw result.error;
|
28
|
+
}
|
29
|
+
|
30
|
+
fs.writeFileSync(outfile, result.js);
|
31
|
+
fs.writeFileSync(outfile + '.map', result.sourceMap);
|
data/lib/traceur-rb.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'traceur'
|
data/lib/traceur.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require "traceur/version"
|
2
|
+
require "traceur/configuration"
|
3
|
+
require "traceur/compilation_options"
|
4
|
+
require "traceur/node"
|
5
|
+
require "traceur/compiler"
|
6
|
+
|
7
|
+
module Traceur
|
8
|
+
def self.compile(source, opts = {})
|
9
|
+
compiler.compile(source, opts)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.compile_file(source_file, opts = {})
|
13
|
+
compiler.compile_file(File.new(source_file), opts)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.config
|
17
|
+
@config ||= Configuration.new
|
18
|
+
yield @config if block_given?
|
19
|
+
@config
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.assets_path
|
23
|
+
config.assets_path
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.configure
|
27
|
+
yield config
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.node_runner(opts = {})
|
31
|
+
Node::Runner.new({
|
32
|
+
binary: config.node_binary.to_s,
|
33
|
+
modules_path: config.node_modules_path.to_s,
|
34
|
+
env: ENV.to_hash
|
35
|
+
}.merge(opts))
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.compiler
|
39
|
+
Compiler.new(runner: node_runner,
|
40
|
+
compile_script_path: config.compile_script_path.to_s,
|
41
|
+
default_compilation_options: config.default_compilation_options)
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Traceur
|
4
|
+
class CompilationOptions
|
5
|
+
def initialize(options = {})
|
6
|
+
@options = {}
|
7
|
+
merge!(options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def []=(name, value)
|
11
|
+
@options[normalize(name)] = value
|
12
|
+
end
|
13
|
+
|
14
|
+
def [](name)
|
15
|
+
@options[normalize(name)]
|
16
|
+
end
|
17
|
+
|
18
|
+
def merge!(options)
|
19
|
+
options.each do |key, value|
|
20
|
+
self[key] = value
|
21
|
+
end
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
def merge(options)
|
26
|
+
CompilationOptions.new(self).merge!(options)
|
27
|
+
end
|
28
|
+
|
29
|
+
def each(&block)
|
30
|
+
@options.each(&block)
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_hash
|
34
|
+
@options
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_json
|
38
|
+
to_hash.to_json
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def respond_to_missing?(name, include_private)
|
44
|
+
true
|
45
|
+
end
|
46
|
+
|
47
|
+
def method_missing(name, *args, &block)
|
48
|
+
return self[name] = args.first if setter?(name, args)
|
49
|
+
return self[name] if getter?(name, args)
|
50
|
+
super
|
51
|
+
end
|
52
|
+
|
53
|
+
def setter?(name, args)
|
54
|
+
name.to_s.end_with?("=") && args.size == 1
|
55
|
+
end
|
56
|
+
|
57
|
+
def getter?(name, args)
|
58
|
+
args.size == 0
|
59
|
+
end
|
60
|
+
|
61
|
+
def normalize(name)
|
62
|
+
name.to_s.gsub(/_[a-z]/) { |m| m.upcase }.gsub('_', '').gsub(/=$/, '').to_sym
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
|
3
|
+
module Traceur
|
4
|
+
class Compiler
|
5
|
+
def initialize(opts = {})
|
6
|
+
@runner = opts.fetch(:runner)
|
7
|
+
@compile_script_path = opts.fetch(:compile_script_path)
|
8
|
+
@default_compilation_options = opts.fetch(:default_compilation_options)
|
9
|
+
end
|
10
|
+
|
11
|
+
def compile(source, opts = {})
|
12
|
+
compile_file(tempfile(source), opts)
|
13
|
+
end
|
14
|
+
|
15
|
+
def compile_file(infile, opts = {})
|
16
|
+
options = default_compilation_options.merge(opts)
|
17
|
+
outfile = Tempfile.new('out.js')
|
18
|
+
runner.run(arguments: [compile_script_path, infile.path, outfile.path, options.to_json])
|
19
|
+
outfile.read
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def tempfile(source)
|
25
|
+
Tempfile.new('in.js').tap do |f|
|
26
|
+
f.write(source)
|
27
|
+
f.close
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
attr_reader :runner, :compile_script_path, :default_compilation_options
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
module Traceur
|
4
|
+
class Configuration
|
5
|
+
attr_writer :node_binary
|
6
|
+
attr_writer :node_modules_path
|
7
|
+
attr_writer :traceur_runtime_path
|
8
|
+
attr_writer :compile_script_path
|
9
|
+
|
10
|
+
def node_binary
|
11
|
+
@node_binary ||= "node"
|
12
|
+
end
|
13
|
+
|
14
|
+
def node_modules_path
|
15
|
+
@node_modules_path ||= root_dir.join("vendor", "node_modules")
|
16
|
+
end
|
17
|
+
|
18
|
+
def traceur_runtime_path
|
19
|
+
@traceur_runtime_path ||= node_modules_path.join("traceur", "bin", "traceur-runtime.js")
|
20
|
+
end
|
21
|
+
|
22
|
+
def assets_path
|
23
|
+
traceur_runtime_path.dirname.to_s
|
24
|
+
end
|
25
|
+
|
26
|
+
def compile_script_path
|
27
|
+
@compile_script_path ||= root_dir.join("lib", "js", "compile.js")
|
28
|
+
end
|
29
|
+
|
30
|
+
def default_compilation_options
|
31
|
+
@default_compilation_options ||= CompilationOptions.new(
|
32
|
+
modules: :inline,
|
33
|
+
source_map: true,
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def default_compilation_options=(hash)
|
38
|
+
@default_compilation_options = CompilationOptions.new(hash)
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def root_dir
|
44
|
+
Pathname.new(__FILE__).join("..", "..", "..")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/traceur/node.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "traceur/node/runner"
|
2
|
+
require "traceur/node/command_result"
|
3
|
+
|
4
|
+
module Traceur
|
5
|
+
class NodeCommandError < StandardError
|
6
|
+
end
|
7
|
+
|
8
|
+
module Node
|
9
|
+
def self.eval(script)
|
10
|
+
Traceur.node_runner.run(
|
11
|
+
input: script,
|
12
|
+
on_error: ->(r){raise_command_error(r)}).stdout
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.exec(*args)
|
16
|
+
Traceur.node_runner.run(
|
17
|
+
arguments: args,
|
18
|
+
on_error: ->(r){raise_command_error(r)}).stdout
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.raise_command_error(result)
|
22
|
+
raise NodeCommandError,
|
23
|
+
"Node command returned non-0 exit status: #{result.exit_status}. Stderr was:\n#{result.stderr}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Traceur
|
2
|
+
module Node
|
3
|
+
class CommandResult < Struct.new(:status, :stdout, :stderr)
|
4
|
+
def initialize(opts = {})
|
5
|
+
self.status = opts[:status]
|
6
|
+
self.stdout = opts[:stdout]
|
7
|
+
self.stderr = opts[:stderr]
|
8
|
+
end
|
9
|
+
|
10
|
+
def on_error
|
11
|
+
yield(self) if error?
|
12
|
+
self
|
13
|
+
end
|
14
|
+
|
15
|
+
def error?
|
16
|
+
!success?
|
17
|
+
end
|
18
|
+
|
19
|
+
def success?
|
20
|
+
exit_status == 0
|
21
|
+
end
|
22
|
+
|
23
|
+
def exit_status
|
24
|
+
status.exitstatus
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|