ruby_es6_module_transpiler 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruby_es6_module_transpiler/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruby_es6_module_transpiler"
8
+ spec.version = RubyEs6ModuleTranspiler::VERSION
9
+ spec.authors = ["Irvin Zhan"]
10
+ spec.description = %q{Ruby ES6 Module Transpiler is a bridge to the JS ES6 Module Transpiler}
11
+ spec.summary = %q{Preparing your JS for the next generation ES6. Uses Square's ES6 Module Transpiler (https://github.com/square/es6-module-transpiler)}
12
+ spec.homepage = "https://github.com/izhan/ruby_es6_module_transpiler"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency 'execjs'
21
+
22
+ spec.add_development_dependency "rspec"
23
+ spec.add_development_dependency "bundler", "~> 1.3"
24
+ spec.add_development_dependency "rake"
25
+ end
@@ -0,0 +1,16 @@
1
+ define(
2
+ ['exports'],
3
+ function(__exports__) {
4
+ 'use strict';
5
+ var get = function(obj, key) {
6
+ return obj[key];
7
+ };
8
+
9
+ var set = function(obj, key, value) {
10
+ obj[key] = value;
11
+ return obj;
12
+ };
13
+
14
+ __exports__.get = get;
15
+ __exports__.set = set;
16
+ });
@@ -0,0 +1,10 @@
1
+ var get = function(obj, key) {
2
+ return obj[key];
3
+ };
4
+
5
+ var set = function(obj, key, value) {
6
+ obj[key] = value;
7
+ return obj;
8
+ };
9
+
10
+ export { get, set };
@@ -0,0 +1,7 @@
1
+ define(
2
+ ["ember"],
3
+ function(__dependency1__) {
4
+ "use strict";
5
+ var get = __dependency1__.get;
6
+ var set = __dependency1__.set;
7
+ });
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ var get = require("ember").get;
3
+ var set = require("ember").set;
@@ -0,0 +1 @@
1
+ import { get, set } from 'ember';
@@ -0,0 +1,5 @@
1
+ (function(__dependency1__) {
2
+ "use strict";
3
+ var get = __dependency1__.get;
4
+ var set = __dependency1__.set;
5
+ })(window.ember);
@@ -0,0 +1,6 @@
1
+ YUI.add("@NAME@", function(Y, NAME, __imports__, __exports__) {
2
+ "use strict";
3
+ var get = __imports__["ember"].get;
4
+ var set = __imports__["ember"].set;
5
+ return __exports__;
6
+ }, "@VERSION@", {"es":true,"requires":["ember"]});
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+ describe RubyES6ModuleTranspiler do
3
+ describe "for importing es6" do
4
+ let(:input) { read_file("import-es6.js") }
5
+ it "should default to amd" do
6
+ transpiled_file = RubyES6ModuleTranspiler.transpile(input)
7
+ expected = read_file("import-amd.js")
8
+ expect(transpiled_file).to eq(expected)
9
+ end
10
+
11
+ it "should allow for cjs compile" do
12
+ transpiled_file = RubyES6ModuleTranspiler.transpile(input, { type: "CJS"})
13
+ expected = read_file("import-cjs.js")
14
+ expect(transpiled_file).to eq(expected)
15
+ end
16
+
17
+ it "should allow for yui compile" do
18
+ transpiled_file = RubyES6ModuleTranspiler.transpile(input, { type: "YUI"})
19
+ expected = read_file("import-yui.js")
20
+ expect(transpiled_file).to eq(expected)
21
+ end
22
+
23
+ it "should allow for globals compile" do
24
+ transpiled_file = RubyES6ModuleTranspiler.transpile(input, { type: "Globals"})
25
+ expected = read_file("import-globals.js")
26
+ expect(transpiled_file).to eq(expected)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ require "ruby_es6_module_transpiler"
2
+ require "support/spec_helpers/file_helpers"
3
+
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+
9
+ config.include SpecHelpers::FileHelpers
10
+
11
+ # Run specs in random order to surface order dependencies. If you find an
12
+ # order dependency and want to debug it, you can fix the order by providing
13
+ # the seed, which is printed after each run.
14
+ # --seed 1234
15
+ config.order = 'random'
16
+ end
@@ -0,0 +1,11 @@
1
+ module SpecHelpers
2
+ module FileHelpers
3
+ def read_file(file)
4
+ k = File.expand_path("../../../js-tests/#{file}", __FILE__)
5
+ file = File.open(k, "rb")
6
+ data = file.read
7
+ file.close
8
+ data
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_es6_module_transpiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Irvin Zhan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-03 00:00:00.000000000 Z
11
+ date: 2014-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -24,16 +24,76 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: Preparing your JS for the next generation ES6. Uses Square's ES6 Module
28
- Transpiler (https://github.com/square/es6-module-transpiler)
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Ruby ES6 Module Transpiler is a bridge to the JS ES6 Module Transpiler
29
70
  email:
30
71
  executables: []
31
72
  extensions: []
32
73
  extra_rdoc_files: []
33
74
  files:
75
+ - .gitignore
76
+ - .rspec
77
+ - Gemfile
78
+ - LICENSE
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
34
82
  - lib/ruby_es6_module_transpiler.rb
83
+ - lib/ruby_es6_module_transpiler/version.rb
35
84
  - lib/support/es6-module-transpiler.js
36
85
  - lib/support/es6-node-runner.js
86
+ - ruby_es6_module_transpiler.gemspec
87
+ - spec/js-tests/export-amd.js
88
+ - spec/js-tests/export-es6.js
89
+ - spec/js-tests/import-amd.js
90
+ - spec/js-tests/import-cjs.js
91
+ - spec/js-tests/import-es6.js
92
+ - spec/js-tests/import-globals.js
93
+ - spec/js-tests/import-yui.js
94
+ - spec/ruby_es6_module_transpiler_spec.rb
95
+ - spec/spec_helper.rb
96
+ - spec/support/spec_helpers/file_helpers.rb
37
97
  homepage: https://github.com/izhan/ruby_es6_module_transpiler
38
98
  licenses:
39
99
  - MIT
@@ -57,5 +117,16 @@ rubyforge_project:
57
117
  rubygems_version: 2.1.11
58
118
  signing_key:
59
119
  specification_version: 4
60
- summary: Ruby ES6 Module Transpiler is a bridge to the JS ES6 Module Transpiler
61
- test_files: []
120
+ summary: Preparing your JS for the next generation ES6. Uses Square's ES6 Module
121
+ Transpiler (https://github.com/square/es6-module-transpiler)
122
+ test_files:
123
+ - spec/js-tests/export-amd.js
124
+ - spec/js-tests/export-es6.js
125
+ - spec/js-tests/import-amd.js
126
+ - spec/js-tests/import-cjs.js
127
+ - spec/js-tests/import-es6.js
128
+ - spec/js-tests/import-globals.js
129
+ - spec/js-tests/import-yui.js
130
+ - spec/ruby_es6_module_transpiler_spec.rb
131
+ - spec/spec_helper.rb
132
+ - spec/support/spec_helpers/file_helpers.rb