reactrb-router 0.8.1 → 0.8.2
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 +9 -4
- data/lib/reactrb-router/component.rb +10 -6
- data/lib/reactrb-router/router.rb +1 -1
- data/lib/reactrb-router/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: bcb4edb9b54f4f2ac22e8cafa8f921e4aea482e7
|
4
|
+
data.tar.gz: e530393c6c40642b8c3a2019b073a637d0f36831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27174a13b67bc1ceeb8dd55ddaba0e20e45abb059edb84d020f36d9f620a13ab5a2c86bc435cd5ce3169ca79864a37c9a43a0d95fb7989c5e090b43a2e4d0b18
|
7
|
+
data.tar.gz: ad25970d326c40fc04497621ed613fe2c61c7d4ca077d6150805a43075a7bb6feb1a0f3bb6b32dcc90a44a431098cde65c584d23d0b3cd510c05677613850d34
|
data/README.md
CHANGED
@@ -5,9 +5,14 @@ Reactrb Router allows you write and use the React Router in Ruby through Opal.
|
|
5
5
|
### Note
|
6
6
|
|
7
7
|
This gem is in the process of being re-written. It will be based on latest react-router which is way better. Please see the [v2-4-0 branch](https://github.com/reactrb/reactrb-router/tree/v2-4-0).
|
8
|
-
If you you want to use this branch with `reactrb-rails-generator`, be sure to remove `require 'react_router` from `components.rb`. And to use the new Router syntax as per the docs.
|
9
8
|
|
10
|
-
|
9
|
+
During the transition you will need to pick between the following branches:
|
10
|
+
|
11
|
+
1. **0-7-stable** is the source for the deprecated reactive-router gem, and is compatible with the deprecated reactive-ruby gem.
|
12
|
+
2. **0-8-stable** is the current active source for reactrb-router, and is compatible with the reactrb gem, and is bundled with the pre 1.0 react-router js library source.
|
13
|
+
3. **v2-4-0** is being developed, and is compatible with the latest reactrb and react-router. While not released, it is stable and is recommended if you are developing a new app and need a router.
|
14
|
+
|
15
|
+
## Installation (0.8 and beyond...)
|
11
16
|
|
12
17
|
Add this line to your application's Gemfile:
|
13
18
|
|
@@ -21,9 +26,9 @@ And then execute:
|
|
21
26
|
|
22
27
|
Or install it yourself as:
|
23
28
|
|
24
|
-
$ gem install
|
29
|
+
$ gem install reactrb-router
|
25
30
|
|
26
|
-
## Usage
|
31
|
+
## Usage (0.8 only)
|
27
32
|
|
28
33
|
The router is a React component that loads other components depending on the current URL.
|
29
34
|
|
@@ -1,15 +1,19 @@
|
|
1
1
|
module React
|
2
|
+
# adds router_handler method, and overrides the built_in tag method
|
2
3
|
module Component
|
3
|
-
module ClassMethods
|
4
|
-
end
|
5
|
-
|
6
4
|
def route_handler(*args)
|
7
5
|
Router::RR::RouteHandler(*args)
|
8
6
|
end
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
class << self
|
9
|
+
alias _reactrb_router_original_included included
|
10
|
+
def included(base)
|
11
|
+
_reactrb_router_original_included(base)
|
12
|
+
base.define_method :link do |opts = {}, &block|
|
13
|
+
opts[:params] = opts[:params].to_n if opts[:params]
|
14
|
+
Router::RR::Link(opts, &block)
|
15
|
+
end
|
16
|
+
end
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reactrb-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam George
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.4.8
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: react-router for Opal, part of the reactrb gem family
|