sprockets-cjsx 0.0.1 → 0.0.2

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: 75eafa7a72fcdbb640392821ba0c9bd952832973
4
- data.tar.gz: bd94da891313b765c95fa7a27290c608b8f811f4
3
+ metadata.gz: 57c1fce570d667784c3a19296c0dbfdcb98d30f6
4
+ data.tar.gz: 93c0ce3c354fcf648fcaa95602a7d5fc988bc76d
5
5
  SHA512:
6
- metadata.gz: 453589473ab4879748d3240779a0b0cfd8808d80ecbffe19c60819ff6e07468763ea95eba07dbc27153e6749419ebdf104a80d60d01d6369e43e216691c11244
7
- data.tar.gz: 45378d7cf36b5e30b0fcbee1c1ab607a3f6b1242bddb527b462283920050306dfb1c087d3a4300530bf34a01cf3e0b8ec2e870981e1e0c03a30608636ef1a767
6
+ metadata.gz: 86f3d44ad15250273b9414cd0b29fc95366280ca0fb64aa25f7fbcd3daaededdaf969ec9bb163f9d98e872411adc3e5688cfd1442eb3c816dac2b9a1b1e1d786
7
+ data.tar.gz: bb00b144fe2624cf5a51c76b1555421457cb1120f353f26890fe54bc176fedbd0bdce811026fdb15470f2539a07f45126d0b2eb681241d49e0a43e8312ad1e67
@@ -6,19 +6,18 @@ module Sprockets
6
6
  module CJSX
7
7
  module PreProcessor
8
8
  def self.call(input)
9
- coffeescript = CoffeeReact.transform(input[:data])
10
- javascript = CoffeeScript.compile(coffeescript)
11
- { data: javascript }
9
+ { data: CoffeeReact.transform(input[:data]) }
12
10
  end
13
11
  end
14
12
 
15
- module PostProcessor
13
+ module Transformer
16
14
  def self.call(input)
17
- { data: CoffeeReact.jstransform(input[:data]) }
15
+ { data: CoffeeScript.compile(input[:data]) }
18
16
  end
19
17
  end
20
18
  end
21
19
  end
22
20
 
23
- Sprockets.register_preprocessor "application/javascript", Sprockets::CJSX::PreProcessor
24
- Sprockets.register_postprocessor "application/javascript", Sprockets::CJSX::PreProcessor
21
+ Sprockets.register_mime_type "text/coffeescript", extensions: [".coffee", ".coffee.erb"]
22
+ Sprockets.register_preprocessor "text/coffeescript", Sprockets::CJSX::PreProcessor
23
+ Sprockets.register_transformer "text/coffeescript", "application/javascript", Sprockets::CJSX::Transformer
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |g|
2
- g.name = "sprockets-cjsx"
3
- g.version = "0.0.1"
4
- g.licenses = ["MIT"]
5
- g.summary = "CJSX with Sprockets"
6
- g.description = "Allows you to use CJSX with Sprockets by adding a pre and post processor that transforms your Coffeescript with coffee-react"
7
- g.author = "Tom Prats"
8
- g.email = "tom@tomprats.com"
9
- g.homepage = "https://github.com/tomprats/sprockets-cjsx"
2
+ g.name = "sprockets-cjsx"
3
+ g.version = "0.0.2"
4
+ g.licenses = ["MIT"]
5
+ g.summary = "CJSX with Sprockets"
6
+ g.description = "Allows you to use CJSX with Sprockets"
7
+ g.author = "Tom Prats"
8
+ g.email = "tom@tomprats.com"
9
+ g.homepage = "https://github.com/tomprats/sprockets-cjsx"
10
10
 
11
11
  g.files = `git ls-files`.split($/)
12
12
  g.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-cjsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Prats
@@ -52,8 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: Allows you to use CJSX with Sprockets by adding a pre and post processor
56
- that transforms your Coffeescript with coffee-react
55
+ description: Allows you to use CJSX with Sprockets
57
56
  email: tom@tomprats.com
58
57
  executables: []
59
58
  extensions: []