katgut 0.0.4 → 0.0.5
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 +29 -0
- data/config/routes.rb +1 -1
- data/lib/katgut/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: f8697ef6393b674720a4de45f8afdde983cb50ae
|
4
|
+
data.tar.gz: 732d22aee2fbf4c09283b424fe3ae51cdd079536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c192da2e1ac888d7bf7cb84de20fb217978c26c4f40f02db1ee0532a9ec94a9cb06660211d8a88c59cb83dfa9377b8b96227ecaf711f1e78f1442696d8423e83
|
7
|
+
data.tar.gz: 9f676b81ac6c783e09ac3b0f736ff2a63219a76bf2d1043eed566a85ada1b1bc9537fa3eda17a2d4e7889feb6947e33754db2bedeb743c087aa4f550580ee934
|
data/README.md
CHANGED
@@ -76,6 +76,35 @@ Katgut::Rule.new(source: "go-to-google", destination: "https://www.google.co.jp/
|
|
76
76
|
# GET /katgut/go-to-google => GET https://www.google.co.jp/
|
77
77
|
```
|
78
78
|
|
79
|
+
## URL helpers
|
80
|
+
Katgut defines url helpers to generate redirection urls.
|
81
|
+
|
82
|
+
Suppose the engine is mounted to your app in this way:
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
# config/routes.rb
|
86
|
+
Rails.application.routes.draw do
|
87
|
+
mount Katgut::Engine => "/katgut"
|
88
|
+
end
|
89
|
+
```
|
90
|
+
|
91
|
+
Then you can access predefined url helpers like this:
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
# app/controllers/xxxx_controller.rb
|
95
|
+
|
96
|
+
katgut.rule_path("source_string") # => "/katgut/source_string"
|
97
|
+
```
|
98
|
+
|
99
|
+
You can see all the predefined helpers in `Routes for Katgut::Engine` section in the list that `rake routes` generates.
|
100
|
+
|
101
|
+
```bash
|
102
|
+
$ rake routes | grep --ignore-case katgut
|
103
|
+
|
104
|
+
Routes for Katgut::Engine:
|
105
|
+
rule GET /:id(.:format) katgut/rules#show
|
106
|
+
```
|
107
|
+
|
79
108
|
## Customization
|
80
109
|
You can customize the behavour of the gem through the initializer script.
|
81
110
|
|
data/config/routes.rb
CHANGED
data/lib/katgut/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katgut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HAMADA Kazuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|