repres-react 1.0.4 → 1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/app/helpers/repres/react/application_helper.rb +5 -0
- data/app/views/repres/react/_script.html.erb +2 -2
- data/lib/repres/react/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0883a8b54fff461519c462ed37aec500f6f6e028
|
4
|
+
data.tar.gz: 5a8bdfd740e67607f96aaba0d9d3381b4c3509fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,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.
|
4
|
-
<%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:'react-dom', '15.3.
|
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) %>
|
data/lib/repres/react/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|