ember-es6_template 0.4.4 → 0.5.0

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: 3150df9a76eddaf0615b50a14e65f16a028496f4
4
- data.tar.gz: 2d59611860fd0f8cce7355eaaddf565634399ea4
3
+ metadata.gz: 42edda08f0f4c6a3f5fdf6484094568146f9717e
4
+ data.tar.gz: 2d764e7c029fd1ffb91ad2030496f5894ce09459
5
5
  SHA512:
6
- metadata.gz: 8074ff15eea7302a8c38e8291d204b7f6379ad4bedd3b946ab664a562ce86e7680a7fa3febea3c5c2f9ccd9f4922ccfe0b3ffc0d8627f4b96ddfa5d86a120b18
7
- data.tar.gz: 9b4a6143562709424fff07bd617cafcf8b6173ea0f0e8d2101716081f1049e5c0a0b8f61e2f726a9972b4a9d18764be8775286d40e909ea33cd39ee112efc089
6
+ metadata.gz: 3d76ccf711685a6245d14f53c4fdf4771309aee6191e2ceb7b645de1889bc2323c73b60bdf4eb7d8dcd1ce412caef5eb55545d68ff2ef9da17d30be93104250f
7
+ data.tar.gz: 9f8853546eaddc91656d11eb4e1c5dbf7699c132a9fe8b64c5548593beab67062e4dae029ed9067364d7b85ffe4a5d098864685a3c9503780fbbed992b18f606
data/.travis.yml CHANGED
@@ -5,13 +5,17 @@ sudo: false
5
5
  rvm:
6
6
  - 2.0.0
7
7
  - 2.1
8
- - 2.2
8
+ - 2.2.4
9
+ - 2.3.0
9
10
 
10
11
  env:
11
12
  matrix:
12
- - SPROCKETS_VERSION="~> 2.1.0"
13
+ - SPROCKETS_VERSION="~> 2.2.0"
13
14
  - SPROCKETS_VERSION="~> 2.12.0"
14
15
  - SPROCKETS_VERSION="~> 3.0.0"
15
16
  - SPROCKETS_VERSION="~> 3.1.0"
16
17
  - SPROCKETS_VERSION="~> 3.2.0"
17
18
  - SPROCKETS_VERSION="~> 3.3.0"
19
+ - SPROCKETS_VERSION="~> 3.4.0"
20
+ - SPROCKETS_VERSION="~> 3.5.0"
21
+ - SPROCKETS_VERSION="~> 4.0.0.beta1"
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency 'babel-transpiler', '>= 0.6.0', '< 0.8'
22
- spec.add_dependency 'sprockets', '>= 2.1', '< 4'
22
+ spec.add_dependency 'sprockets', '>= 2.2', '< 4'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.7'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -8,7 +8,7 @@ module Ember
8
8
  case Sprockets::VERSION
9
9
  when /^2\./
10
10
  require 'ember/es6_template/sprockets2'
11
- when /^3\./
11
+ when /^[34]\./
12
12
  require 'ember/es6_template/sprockets3'
13
13
  else
14
14
  raise "Unsupported sprockets version: #{Sprockets::VERSION}"
@@ -1,17 +1,14 @@
1
1
  module Ember
2
2
  module ES6Template
3
3
  class CoffeeScript < Tilt::CoffeeScriptTemplate
4
- self.default_mime_type = 'application/javascript'
5
-
6
4
  def evaluate(scope, locals, &block)
7
5
  filename = scope.pathname.to_s
8
6
 
9
- @output ||=
10
- if es6?(filename)
11
- ::CoffeeScript.compile(data, options.merge(bare: true))
12
- else
13
- ::CoffeeScript.compile(data, options)
14
- end
7
+ if es6?(filename)
8
+ ::CoffeeScript.compile(data, bare: true)
9
+ else
10
+ super
11
+ end
15
12
  end
16
13
 
17
14
  private
@@ -7,10 +7,29 @@ module Ember
7
7
  autoload :CoffeeScriptHelper, 'ember/es6_template/sprockets3/coffee_script_helper'
8
8
 
9
9
  def self.setup(env)
10
- env.register_engine '.es6', ES6, mime_type: 'application/javascript'
11
- env.register_engine '.module.es6', ES6Module, mime_type: 'application/javascript'
12
- env.register_engine '.module.coffee', CoffeeScriptModule, mime_type: 'application/javascript'
13
- env.register_engine '.coffee', CoffeeScript, mime_type: 'application/javascript' # Force parse as ES6
10
+ env.register_mime_type 'application/ecmascript-6', extensions: %w(.es6)
11
+ env.register_mime_type 'application/ecmascript-6+module', extensions: %w(.module.es6)
12
+ env.register_mime_type 'text/coffeescript', extensions: %w(.es6.coffee .coffee)
13
+ env.register_mime_type 'text/coffeescript+module', extensions: %w(.es6.module.coffee .module.coffee)
14
+
15
+ env.register_transformer 'application/ecmascript-6', 'application/javascript', ES6
16
+ env.register_transformer 'application/ecmascript-6+module', 'application/javascript', ES6Module
17
+ env.register_transformer 'text/coffeescript', 'application/javascript', CoffeeScript
18
+ env.register_transformer 'text/coffeescript+module', 'application/javascript', CoffeeScriptModule
19
+
20
+ env.register_preprocessor 'application/ecmascript-6', Sprockets::DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
21
+ env.register_preprocessor 'application/ecmascript-6+module', Sprockets::DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
22
+ env.register_preprocessor 'text/coffeescript', Sprockets::DirectiveProcessor.new(comments: ["#", ["###", "###"]])
23
+ env.register_preprocessor 'text/coffeescript+module', Sprockets::DirectiveProcessor.new(comments: ["#", ["###", "###"]])
24
+
25
+ if Sprockets::VERSION =~ /^4\./
26
+ env.register_transformer_suffix %w(
27
+ application/ecmascript-6
28
+ application/ecmascript-6+module
29
+ text/coffeescript
30
+ text/coffeescript+module
31
+ ), 'application/\2+ruby', '.erb', Sprockets::ERBProcessor
32
+ end
14
33
  end
15
34
  end
16
35
  end
@@ -5,16 +5,10 @@ module Ember
5
5
  data = input[:data]
6
6
 
7
7
  result = input[:cache].fetch(_cache_key + [data]) do
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
8
+ transform(
9
+ Sprockets::Autoload::CoffeeScript.compile(data, bare: true),
10
+ input
11
+ )
18
12
  end
19
13
 
20
14
  result['code']
@@ -31,10 +25,6 @@ module Ember
31
25
  Sprockets::Autoload::CoffeeScript.version
32
26
  ]
33
27
  end
34
-
35
- def es6?(filename)
36
- File.basename(filename) =~ /\.(?:es6|module)\./
37
- end
38
28
  end
39
29
  end
40
30
  end
@@ -1,5 +1,5 @@
1
1
  module Ember
2
2
  module ES6Template
3
- VERSION = '0.4.4'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  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
4
+ version: 0.5.0
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-03-04 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babel-transpiler
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '2.1'
39
+ version: '2.2'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '4'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '2.1'
49
+ version: '2.2'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '4'