sprockets-es6 0.2.1 → 0.3.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: 82a36bc0f5ee8d90967d3767c553d50a296e438b
4
- data.tar.gz: 219553431e3b2077823f9d69d4c0109fba6c050a
3
+ metadata.gz: 7c67e316bee6ff8e934f7270ca8078a421e18125
4
+ data.tar.gz: fb653c65017338df1a980ae06fe2dc0cf4238820
5
5
  SHA512:
6
- metadata.gz: f0eadc6d1b1abb73e744af70ba0a7e8f0387383cdc629f065f4a4c9255e0f31f08e35f43053b9a104972be2a0989ee9064f5c3d5c49bafe4ea534479b5b4b474
7
- data.tar.gz: 39a8c3325398f34b665d898d9141d81a8701c8611309fd06c80ac43319b5609f00696c99752d87b6a3a8581af819c82cdcfe7f3dedfca84d76e5c9e85a730677
6
+ metadata.gz: 6b57f6d735574f9058d3f757010226c169f79c2e61d31e4765059eba850ca605ca1eae4fc86a1701f1d0edcda507d9e97e603678c1306449ff180dcfa46c5878
7
+ data.tar.gz: f26504ed7b76bc9ebb27a268b606655aee2bd8fe826f403dfc904b6fba690931382160cea32ab43c971a0d040995b4fb4da0b448a339024b5705c3c80f89f5d6
data/lib/sprockets/es6.rb CHANGED
@@ -4,13 +4,30 @@ require 'sprockets/es6/version'
4
4
 
5
5
  module Sprockets
6
6
  class ES6
7
+ def self.instance
8
+ @instance ||= new
9
+ end
10
+
7
11
  def self.call(input)
12
+ instance.call(input)
13
+ end
14
+
15
+ def initialize(options = {})
16
+ @options = options.dup.freeze
17
+
18
+ @cache_key = [
19
+ self.class.name,
20
+ ES6to5.version,
21
+ VERSION,
22
+ @options
23
+ ].freeze
24
+ end
25
+
26
+ def call(input)
8
27
  data = input[:data]
9
- result = input[:cache].fetch(['ES6', VERSION, data]) do
10
- ES6to5.transform(data, sourceMap: true)
28
+ result = input[:cache].fetch(@cache_key + [data]) do
29
+ ES6to5.transform(data, @options)
11
30
  end
12
-
13
- # TODO: result['map']
14
31
  result['code']
15
32
  end
16
33
  end
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  class ES6
3
- VERSION = '0.2.1'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-es6
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-17 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: 6to5