repres-react 1.0.4 → 1.1

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: 97c1ba70c7456c141ddc2b2209d2592fbff9dab4
4
- data.tar.gz: e4b39dc16ba65b18a210c42c4357ec54ca60ad15
3
+ metadata.gz: 0883a8b54fff461519c462ed37aec500f6f6e028
4
+ data.tar.gz: 5a8bdfd740e67607f96aaba0d9d3381b4c3509fe
5
5
  SHA512:
6
- metadata.gz: d880b0113ab29667561a631a5f0ca52eb94b525679f7634600d38a9359fd4a2773a030431cc36c03db7a0c903750c273c9c70ef1da281f98cd047bd847f23bf7
7
- data.tar.gz: 532d6e42cf19ffd068d730198c383cd7e0e5cc9ef99dae2897bbec8ad0a350a9002e7c20f0673a62e60e8ac713882e8e175f39622e6b930a809bdc219b9c2d7e
6
+ metadata.gz: d8b152531dd454a319e55ca01e432d62446063dd07cc5677a89b1975a51252714e38fdf0bda05b0f3bc5685ff63b5af3d318d53a3428fe2644412665e08a3198
7
+ data.tar.gz: 8977799bc90f3c2aa29b33c8c9689d177571a0d08bb7c46fa517a9d0fabed4b0c3db120c9c0988cf1efa80a687fdc59ba6ce3f8a643a18d111984f2c79b75e34
data/README.md CHANGED
@@ -20,6 +20,13 @@ gem 'repres-react'
20
20
 
21
21
 
22
22
 
23
+ ## Include the Helper in your Application Controller before Render the Script with the helper methods
24
+ ```ruby
25
+ helper Repres::React::ApplicationHelper
26
+ ```
27
+
28
+
29
+
23
30
  ## Render the Pre-defined Partials
24
31
 
25
32
  ### Render the Script
@@ -28,16 +35,22 @@ The Script partial includes the HTML script tags for React and its extensions. O
28
35
  The following code snippet does __not__ load any JavaScript library.
29
36
  ```erb
30
37
  <%= render partial: 'repres/react/script' %>
38
+ <!-- or the following line works identically -->
39
+ <%= react_script %>
31
40
  ```
32
41
 
33
42
  The following code snippet loads the latest React JavaScript library.
34
43
  ```erb
35
44
  <%= render partial: 'repres/bootstrap/script', locals: { options: { react: true, 'react-dom': true } } %>
45
+ <!-- or the following line works identically -->
46
+ <%= react_script react: true, 'react-dom': true %>
36
47
  ```
37
48
 
38
49
  The following code snippet loads the React JavaScript library with the given version.
39
50
  ```erb
40
51
  <%= render partial: 'repres/bootstrap/script', locals: { options: { react: { version: '15.0.2' }, 'react-dom': { version: '15.0.2' } } }
52
+ <!-- or the following line works identically -->
53
+ <%= react_script react: { version: '15.0.2' }, 'react-dom': { version: '15.0.2' } %>
41
54
  %>
42
55
  ```
43
56
 
@@ -1,2 +1,7 @@
1
1
  module Repres::React::ApplicationHelper
2
+
3
+ def react_script(options = {})
4
+ render partial: 'repres/react/script', locals: { options: options }
5
+ end
6
+
2
7
  end
@@ -1,4 +1,4 @@
1
1
  <% options = defined?(options) ? options : nil %>
2
2
 
3
- <%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:react, '15.3.0', options)}/react.min.js" if library_enabled?(:react, options) %>
4
- <%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:'react-dom', '15.3.0', options)}/react-dom.min.js" if library_enabled?(:'react-dom', options) %>
3
+ <%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:react, '15.3.1', options)}/react.min.js" if library_enabled?(:react, options) %>
4
+ <%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:'react-dom', '15.3.1', options)}/react-dom.min.js" if library_enabled?(:'react-dom', options) %>
@@ -1,5 +1,5 @@
1
1
  module Repres
2
2
  module React
3
- VERSION = '1.0.4'.freeze
3
+ VERSION = '1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repres-react
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails