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 +4 -4
- data/lib/sprockets-cjsx.rb +6 -7
- data/sprockets-cjsx.gemspec +8 -8
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c1fce570d667784c3a19296c0dbfdcb98d30f6
|
4
|
+
data.tar.gz: 93c0ce3c354fcf648fcaa95602a7d5fc988bc76d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86f3d44ad15250273b9414cd0b29fc95366280ca0fb64aa25f7fbcd3daaededdaf969ec9bb163f9d98e872411adc3e5688cfd1442eb3c816dac2b9a1b1e1d786
|
7
|
+
data.tar.gz: bb00b144fe2624cf5a51c76b1555421457cb1120f353f26890fe54bc176fedbd0bdce811026fdb15470f2539a07f45126d0b2eb681241d49e0a43e8312ad1e67
|
data/lib/sprockets-cjsx.rb
CHANGED
@@ -6,19 +6,18 @@ module Sprockets
|
|
6
6
|
module CJSX
|
7
7
|
module PreProcessor
|
8
8
|
def self.call(input)
|
9
|
-
|
10
|
-
javascript = CoffeeScript.compile(coffeescript)
|
11
|
-
{ data: javascript }
|
9
|
+
{ data: CoffeeReact.transform(input[:data]) }
|
12
10
|
end
|
13
11
|
end
|
14
12
|
|
15
|
-
module
|
13
|
+
module Transformer
|
16
14
|
def self.call(input)
|
17
|
-
{ data:
|
15
|
+
{ data: CoffeeScript.compile(input[:data]) }
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
22
20
|
|
23
|
-
Sprockets.
|
24
|
-
Sprockets.
|
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
|
data/sprockets-cjsx.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |g|
|
2
|
-
g.name
|
3
|
-
g.version
|
4
|
-
g.licenses
|
5
|
-
g.summary
|
6
|
-
g.description
|
7
|
-
g.author
|
8
|
-
g.email
|
9
|
-
g.homepage
|
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.
|
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
|
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: []
|