repres-react 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -1
- data/app/assets/javascripts/repres/react/application.js +1 -1
- data/app/assets/stylesheets/repres/react/application.css +0 -1
- data/app/views/layouts/repres/react/application.html.erb +2 -1
- data/app/views/repres/react/_script.html.erb +2 -2
- data/lib/repres/react/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5eef17a5767b97cdc9d7cfa39ce061dafd8b1ed
|
4
|
+
data.tar.gz: eb5cf0f8213f2631e0320f6796c72da9a3f94e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d115e52f14dba2f5ffcbfd0cb41ba3a30f07912cd25f0cd99647e1ef533c7915693f6f8a62d4adf8181bd6868b373b50a391606804eb90326591327f1804c593
|
7
|
+
data.tar.gz: 45322fd6341e74e79ca938c17ebc7d7f9e84d97433c980172598b2de2a209ce77234c5a91d1d03f00b4a2e7f92a1d380b77dba83af145117b9dd04849342b431
|
data/README.md
CHANGED
@@ -1,2 +1,46 @@
|
|
1
|
-
#
|
1
|
+
# Repres React React资源表现引擎
|
2
|
+
|
3
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/repres-react.svg)](https://badge.fury.io/rb/repres-react)
|
5
|
+
|
2
6
|
Repres (REsource PRESentation) is a series of resource presentation engines. The React resource presentation engine includes React-based resource presentation templates & snippets. Repres (资源表现)是一系列的资源表现引擎。React 资源表现引擎包括基于React的资源表现模版和片段。
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## Recent Update
|
11
|
+
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
12
|
+
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
## Usage in Gemfile
|
17
|
+
```ruby
|
18
|
+
gem 'repres-react'
|
19
|
+
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
## Render the Pre-defined Partials
|
24
|
+
|
25
|
+
### Render the Script
|
26
|
+
The Script partial includes the HTML script tags for React and its extensions. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
|
27
|
+
|
28
|
+
The following code snippet does __not__ load any JavaScript library.
|
29
|
+
```erb
|
30
|
+
<%= render partial: 'repres/react/script' %>
|
31
|
+
```
|
32
|
+
|
33
|
+
The following code snippet loads the latest React JavaScript library.
|
34
|
+
```erb
|
35
|
+
<%= render partial: 'repres/bootstrap/script', locals: { options: { react: true, 'react-dom': true } } %>
|
36
|
+
```
|
37
|
+
|
38
|
+
The following code snippet loads the React JavaScript library with the given version.
|
39
|
+
```erb
|
40
|
+
<%= render partial: 'repres/bootstrap/script', locals: { options: { react: { version: '15.0.2' }, 'react-dom': { version: '15.0.2' } } }
|
41
|
+
%>
|
42
|
+
```
|
43
|
+
|
44
|
+
The following JavaScript libraries are switchable, and the version can be configurable:
|
45
|
+
- :react
|
46
|
+
- :'react-dom'
|
@@ -3,12 +3,13 @@
|
|
3
3
|
<head>
|
4
4
|
<title>Repres React</title>
|
5
5
|
<%= stylesheet_link_tag "repres/react/application", media: "all" %>
|
6
|
-
<%= javascript_include_tag "repres/react/application" %>
|
7
6
|
<%= csrf_meta_tags %>
|
8
7
|
</head>
|
9
8
|
<body>
|
10
9
|
|
11
10
|
<%= yield %>
|
12
11
|
|
12
|
+
<%= javascript_include_tag 'repres/react/application' %>
|
13
|
+
|
13
14
|
</body>
|
14
15
|
</html>
|
@@ -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.0
|
4
|
-
<%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:'react-dom', '15.0
|
3
|
+
<%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:react, '15.1.0', options)}/react.min.js" if library_enabled?(:react, options) %>
|
4
|
+
<%= javascript_include_tag "//cdn.bootcss.com/react/#{library_version(:'react-dom', '15.1.0', 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:
|
4
|
+
version: 1.0.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-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.4
|
84
|
+
rubygems_version: 2.6.4
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Repres React Resource Presentation Engine React资源表现引擎
|