sprockets-coffee-react 3.0.1 → 3.4.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: e1df07468e1e001c592a22e4b07b22e23a5df5dc
4
- data.tar.gz: edc0f4812b388d1b6c39c95e4ca378fd0a61cc2d
3
+ metadata.gz: d8bd8ba953b5e675a55b0b47d3f4ea1d881ad783
4
+ data.tar.gz: 05ff3369f64f40eac02a8c1bff011f8e2ac7675b
5
5
  SHA512:
6
- metadata.gz: b10ba3f10c46f3f7b5c660cdc798bbbe13dcf1221d718ae08befcb4d81893fe3838ffe2bb0df7e0797c12c32b1a7c8e011f9e25ba978eee9123dd27dfa41c4b2
7
- data.tar.gz: aa06502345a2e77e28f5891216196826b6e842119d00f571ebf0b055f03f08f101b4afb50642275d2ab05f0a3ca88eab298193dfea7f4442abd1ef1a2834e018
6
+ metadata.gz: be0a274c95ce44e0d271cf2ab7f41d1410ffb0929c086708d8a05f8e7e301014570da3149f21472795abd124d90d8df47e542c37249cb29be145e153db830da3
7
+ data.tar.gz: fce2b52be9640a2944f2380028bf2ae4ae5e4776081c3e0d66d328b872daf0f080d6048ba617f8c17aa898c98c24786b6e7542ac2dc1329ae3664c0e88d3756b
@@ -0,0 +1,15 @@
1
+ require 'sprockets'
2
+ require 'tilt'
3
+ require 'coffee-react'
4
+
5
+ module Sprockets
6
+ class CoffeeReactPostprocessor < Tilt::Template
7
+
8
+ def prepare
9
+ end
10
+
11
+ def evaluate(scope, locals, &block)
12
+ ::CoffeeReact.jstransform(data)
13
+ end
14
+ end
15
+ end
@@ -1,6 +1,7 @@
1
1
  require 'sprockets'
2
2
  require 'tilt'
3
3
  require 'coffee-react'
4
+ require 'sprockets/coffee-react-postprocessor'
4
5
 
5
6
  module Sprockets
6
7
  # Preprocessor that runs CJSX source files through coffee-react-transform
@@ -21,6 +22,7 @@ module Sprockets
21
22
 
22
23
  def self.install(environment = ::Sprockets)
23
24
  environment.register_preprocessor 'application/javascript', Sprockets::CoffeeReact
25
+ environment.register_postprocessor 'application/javascript', Sprockets::CoffeeReactPostprocessor
24
26
  environment.register_engine '.cjsx', Sprockets::CoffeeReactScript
25
27
  environment.register_engine '.js.cjsx', Sprockets::CoffeeReactScript
26
28
  end
@@ -1,5 +1,6 @@
1
1
  require 'sprockets'
2
2
  require 'sprockets/coffee-react'
3
+ require 'sprockets/coffee-react-postprocessor'
3
4
 
4
5
  if defined?(Rails)
5
6
  module Sprockets
@@ -19,6 +20,7 @@ if defined?(Rails)
19
20
 
20
21
  # app.assets.register_preprocessor '.coffee', Sprockets::CoffeeReact
21
22
  app.assets.register_preprocessor 'application/javascript', Sprockets::CoffeeReact
23
+ app.assets.register_postprocessor 'application/javascript', Sprockets::CoffeeReactPostprocessor
22
24
  app.assets.register_engine '.cjsx', Sprockets::CoffeeReactScript
23
25
  app.assets.register_engine '.js.cjsx', Sprockets::CoffeeReactScript
24
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-coffee-react
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Friend
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-react
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.1
19
+ version: 3.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.1
26
+ version: 3.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coffee-script
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -79,6 +79,7 @@ files:
79
79
  - README.rdoc
80
80
  - Rakefile
81
81
  - lib/sprockets-coffee-react.rb
82
+ - lib/sprockets/coffee-react-postprocessor.rb
82
83
  - lib/sprockets/coffee-react-script.rb
83
84
  - lib/sprockets/coffee-react.rb
84
85
  - lib/sprockets/coffee-react/engine.rb