sprockets-coffee-react 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +4 -4
- data/lib/sprockets/coffee-react-script.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b560b0be65f7f8e4856a4e82e66e62cfd0e1ce32
|
4
|
+
data.tar.gz: 0adf201c9796e4c5605f14910d396a3b382d537e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd48f18672a1cfd28d039982fab64dd883e59fe1e1539464dc2145b03a3df66fde7fed17e91ea44c76ae4d3064308b9657e27bdb19db201f600841eaa746d9bc
|
7
|
+
data.tar.gz: 2de32471a83f018742c2aea0e47a5d1f7ac78fa8d6eeeadb26409eee1a220eec39ee843ab4565802e14888a53f56f805fc8d160daaa6981b20ffb40ba434e552
|
data/README.rdoc
CHANGED
@@ -6,16 +6,16 @@ Add this to your Gemfile:
|
|
6
6
|
|
7
7
|
gem 'sprockets-coffee-react'
|
8
8
|
|
9
|
-
Place a <tt>.js.coffee.cjsx</tt> or <tt>.js.cjsx</tt> (or a <tt>.js.coffee</tt> file with a
|
10
|
-
<tt>@cjsx</tt> pragma) in your assets directory.
|
9
|
+
Place a <tt>.js.coffee.cjsx</tt> or <tt>.js.cjsx</tt> file (or a <tt>.js.coffee</tt> file with a
|
10
|
+
<tt>@cjsx</tt> pragma) in your assets directory. When you require it into other JS files the CJSX
|
11
|
+
markup will be transformed and compiled to Javascript.
|
11
12
|
|
12
13
|
Eg. if you have a file called <tt>my-component.js.coffee</tt> which contains
|
13
14
|
some CJSX code, require it from <tt>application.js</tt> or somewhere else:
|
14
15
|
|
15
16
|
//= require my-component
|
16
17
|
|
17
|
-
|
18
|
-
Javascript.
|
18
|
+
|
19
19
|
|
20
20
|
== License
|
21
21
|
|
@@ -14,7 +14,7 @@ module Sprockets
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def evaluate(scope, locals, &block)
|
17
|
-
if scope.pathname.to_s =~
|
17
|
+
if scope.pathname.to_s =~ /\.coffee\.cjsx/
|
18
18
|
::CoffeeReact.transform(data)
|
19
19
|
elsif scope.pathname.to_s =~ CJSX_EXTENSION || data =~ CJSX_PRAGMA
|
20
20
|
::CoffeeScript.compile(::CoffeeReact.transform(data))
|