ember-es6_template 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3150df9a76eddaf0615b50a14e65f16a028496f4
|
4
|
+
data.tar.gz: 2d59611860fd0f8cce7355eaaddf565634399ea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8074ff15eea7302a8c38e8291d204b7f6379ad4bedd3b946ab664a562ce86e7680a7fa3febea3c5c2f9ccd9f4922ccfe0b3ffc0d8627f4b96ddfa5d86a120b18
|
7
|
+
data.tar.gz: 9b4a6143562709424fff07bd617cafcf8b6173ea0f0e8d2101716081f1049e5c0a0b8f61e2f726a9972b4a9d18764be8775286d40e909ea33cd39ee112efc089
|
@@ -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
|
@@ -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
|
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.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: babel-transpiler
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
171
|
rubyforge_project:
|
172
|
-
rubygems_version: 2.
|
172
|
+
rubygems_version: 2.5.1
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: The tilt template for Ember specified ES6.
|