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.
- checksums.yaml +4 -4
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +8 -0
- data/lib/ruby_es6_module_transpiler.rb +6 -9
- data/lib/ruby_es6_module_transpiler/version.rb +3 -0
- data/lib/support/es6-module-transpiler.js +3 -7191
- data/ruby_es6_module_transpiler.gemspec +25 -0
- data/spec/js-tests/export-amd.js +16 -0
- data/spec/js-tests/export-es6.js +10 -0
- data/spec/js-tests/import-amd.js +7 -0
- data/spec/js-tests/import-cjs.js +3 -0
- data/spec/js-tests/import-es6.js +1 -0
- data/spec/js-tests/import-globals.js +5 -0
- data/spec/js-tests/import-yui.js +6 -0
- data/spec/ruby_es6_module_transpiler_spec.rb +29 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/spec_helpers/file_helpers.rb +11 -0
- metadata +77 -6
@@ -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 @@
|
|
1
|
+
import { get, set } from '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
|
data/spec/spec_helper.rb
ADDED
@@ -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
|
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.
|
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-
|
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
|
-
|
28
|
-
|
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:
|
61
|
-
|
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
|