ember-es6_template 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/lib/ember/es6_template.rb +2 -2
- data/lib/ember/es6_template/{sprockets2.rb → sprockets-legacy.rb} +3 -3
- data/lib/ember/es6_template/{sprockets2 → sprockets-legacy}/coffee_script.rb +8 -5
- data/lib/ember/es6_template/{sprockets2 → sprockets-legacy}/es6.rb +0 -0
- data/lib/ember/es6_template/{sprockets2 → sprockets-legacy}/es6module.rb +0 -0
- data/lib/ember/es6_template/{sprockets3.rb → sprockets.rb} +5 -5
- data/lib/ember/es6_template/{sprockets3 → sprockets}/coffee_script.rb +0 -0
- data/lib/ember/es6_template/{sprockets3 → sprockets}/coffee_script_helper.rb +14 -4
- data/lib/ember/es6_template/{sprockets3 → sprockets}/coffee_script_module.rb +0 -0
- data/lib/ember/es6_template/{sprockets3 → sprockets}/es6.rb +0 -0
- data/lib/ember/es6_template/{sprockets3 → sprockets}/es6module.rb +0 -0
- data/lib/ember/es6_template/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4767d51dcfca91109c78fb8a1cb11e75fdb9675f
|
4
|
+
data.tar.gz: 3969bc707633b3ce5a2a2623967f0a5330863542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80700526177a4185c7e81918f06924e26adf8bdcc12947fa3fdf47a87c9411004632c9fcedb2f0cf5362db74540dbdea33c9cfccbca4b03f7be9d811ed8118f5
|
7
|
+
data.tar.gz: ca3af93e133d8e124b42c3eb543cef4d0c0643780e275e26ee808615c7c1d2d3caa7afd258c6e9a075910afd467d460c139f87035569f0a1411b1e7d2fd08797
|
data/.travis.yml
CHANGED
data/lib/ember/es6_template.rb
CHANGED
@@ -7,9 +7,9 @@ module Ember
|
|
7
7
|
module ES6Template
|
8
8
|
case Sprockets::VERSION
|
9
9
|
when /^2\./
|
10
|
-
require 'ember/es6_template/
|
10
|
+
require 'ember/es6_template/sprockets-legacy'
|
11
11
|
when /^[34]\./
|
12
|
-
require 'ember/es6_template/
|
12
|
+
require 'ember/es6_template/sprockets'
|
13
13
|
else
|
14
14
|
raise "Unsupported sprockets version: #{Sprockets::VERSION}"
|
15
15
|
end
|
@@ -6,9 +6,9 @@ end
|
|
6
6
|
|
7
7
|
module Ember
|
8
8
|
module ES6Template
|
9
|
-
autoload :ES6, 'ember/es6_template/
|
10
|
-
autoload :ES6Module, 'ember/es6_template/
|
11
|
-
autoload :CoffeeScript, 'ember/es6_template/
|
9
|
+
autoload :ES6, 'ember/es6_template/sprockets-legacy/es6'
|
10
|
+
autoload :ES6Module, 'ember/es6_template/sprockets-legacy/es6module'
|
11
|
+
autoload :CoffeeScript, 'ember/es6_template/sprockets-legacy/coffee_script'
|
12
12
|
|
13
13
|
def self.setup(env)
|
14
14
|
env.register_engine '.es6', ES6
|
@@ -1,14 +1,17 @@
|
|
1
1
|
module Ember
|
2
2
|
module ES6Template
|
3
3
|
class CoffeeScript < Tilt::CoffeeScriptTemplate
|
4
|
+
self.default_mime_type = 'application/javascript'
|
5
|
+
|
4
6
|
def evaluate(scope, locals, &block)
|
5
7
|
filename = scope.pathname.to_s
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
@output ||=
|
10
|
+
if es6?(filename)
|
11
|
+
::CoffeeScript.compile(data, options.merge(bare: true))
|
12
|
+
else
|
13
|
+
::CoffeeScript.compile(data, options)
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
private
|
File without changes
|
File without changes
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Ember
|
2
2
|
module ES6Template
|
3
|
-
autoload :ES6, 'ember/es6_template/
|
4
|
-
autoload :ES6Module, 'ember/es6_template/
|
5
|
-
autoload :CoffeeScript, 'ember/es6_template/
|
6
|
-
autoload :CoffeeScriptModule, 'ember/es6_template/
|
7
|
-
autoload :CoffeeScriptHelper, 'ember/es6_template/
|
3
|
+
autoload :ES6, 'ember/es6_template/sprockets/es6'
|
4
|
+
autoload :ES6Module, 'ember/es6_template/sprockets/es6module'
|
5
|
+
autoload :CoffeeScript, 'ember/es6_template/sprockets/coffee_script'
|
6
|
+
autoload :CoffeeScriptModule, 'ember/es6_template/sprockets/coffee_script_module'
|
7
|
+
autoload :CoffeeScriptHelper, 'ember/es6_template/sprockets/coffee_script_helper'
|
8
8
|
|
9
9
|
def self.setup(env)
|
10
10
|
env.register_mime_type 'application/ecmascript-6', extensions: %w(.es6)
|
File without changes
|
@@ -5,10 +5,16 @@ module Ember
|
|
5
5
|
data = input[:data]
|
6
6
|
|
7
7
|
result = input[:cache].fetch(_cache_key + [data]) do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
if es6?(input[:filename])
|
9
|
+
transform(
|
10
|
+
Sprockets::Autoload::CoffeeScript.compile(data, bare: true),
|
11
|
+
input
|
12
|
+
)
|
13
|
+
else
|
14
|
+
code = Sprockets::Autoload::CoffeeScript.compile(data, bare: false)
|
15
|
+
|
16
|
+
{'code' => code}
|
17
|
+
end
|
12
18
|
end
|
13
19
|
|
14
20
|
result['code']
|
@@ -25,6 +31,10 @@ module Ember
|
|
25
31
|
Sprockets::Autoload::CoffeeScript.version
|
26
32
|
]
|
27
33
|
end
|
34
|
+
|
35
|
+
def es6?(filename)
|
36
|
+
File.basename(filename) =~ /\.(?:es6|module)\./
|
37
|
+
end
|
28
38
|
end
|
29
39
|
end
|
30
40
|
end
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-es6_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: babel-transpiler
|
@@ -138,16 +138,16 @@ files:
|
|
138
138
|
- ember-es6_template.gemspec
|
139
139
|
- lib/ember/es6_template.rb
|
140
140
|
- lib/ember/es6_template/config.rb
|
141
|
-
- lib/ember/es6_template/
|
142
|
-
- lib/ember/es6_template/
|
143
|
-
- lib/ember/es6_template/
|
144
|
-
- lib/ember/es6_template/
|
145
|
-
- lib/ember/es6_template/
|
146
|
-
- lib/ember/es6_template/
|
147
|
-
- lib/ember/es6_template/
|
148
|
-
- lib/ember/es6_template/
|
149
|
-
- lib/ember/es6_template/
|
150
|
-
- lib/ember/es6_template/
|
141
|
+
- lib/ember/es6_template/sprockets-legacy.rb
|
142
|
+
- lib/ember/es6_template/sprockets-legacy/coffee_script.rb
|
143
|
+
- lib/ember/es6_template/sprockets-legacy/es6.rb
|
144
|
+
- lib/ember/es6_template/sprockets-legacy/es6module.rb
|
145
|
+
- lib/ember/es6_template/sprockets.rb
|
146
|
+
- lib/ember/es6_template/sprockets/coffee_script.rb
|
147
|
+
- lib/ember/es6_template/sprockets/coffee_script_helper.rb
|
148
|
+
- lib/ember/es6_template/sprockets/coffee_script_module.rb
|
149
|
+
- lib/ember/es6_template/sprockets/es6.rb
|
150
|
+
- lib/ember/es6_template/sprockets/es6module.rb
|
151
151
|
- lib/ember/es6_template/version.rb
|
152
152
|
homepage: https://github.com/tricknotes/ember-es6_template
|
153
153
|
licenses:
|