routing-filter 0.5.0 → 0.5.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/CHANGELOG.md +4 -0
- data/README.markdown +10 -0
- data/lib/routing_filter/adapters/routers/journey.rb +6 -1
- data/lib/routing_filter/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: 1ed5b0fd6b37f434639ed4dc815e078904dbbe97
|
4
|
+
data.tar.gz: 7fbc04ecd600c259d4c11418b2c26f6662396eae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3050e4f205b0acf5e6487c8b26c4c5a7c5c684d458f4741250bd1165a5441728a20ddfc9722e1211c99d1a95318fd14a78a1b67d4fc04f0f48ac26da25fff41f
|
7
|
+
data.tar.gz: 1634aa93348c90c23e3f259fd1dd9824953dc34ada977e88706ed331c1175b11eb9d9d133cc6c762f50a2819d1891c811278197c4b3ad7412ae6868ce23f681e
|
data/CHANGELOG.md
CHANGED
data/README.markdown
CHANGED
@@ -61,6 +61,16 @@ Rails.application.routes.draw do
|
|
61
61
|
end
|
62
62
|
```
|
63
63
|
|
64
|
+
The locale filter may be configured to not include the default locale:
|
65
|
+
|
66
|
+
# in config/initializers/routing_filter.rb
|
67
|
+
# Do not include default locale in generated URLs
|
68
|
+
RoutingFilter::Locale.include_default_locale = false
|
69
|
+
|
70
|
+
# Then if the default locale is :de
|
71
|
+
# products_path(:locale => 'de') => /products
|
72
|
+
# products_path(:locale => 'en') => /en/products
|
73
|
+
|
64
74
|
### Testing
|
65
75
|
|
66
76
|
RoutingFilter should not be enabled in functional tests by default since the Rails router gets
|
@@ -17,7 +17,12 @@ ActionDispatch::Journey::Router.class_eval do
|
|
17
17
|
find_routes_without_filtering(env).map do |match, parameters, route|
|
18
18
|
[ match, parameters.merge(filter_parameters), route ]
|
19
19
|
end.tap do |match, parameters, route|
|
20
|
-
|
20
|
+
# restore the original path
|
21
|
+
if env.is_a?(Hash)
|
22
|
+
env['PATH_INFO'] = original_path
|
23
|
+
else
|
24
|
+
env.path_info = original_path
|
25
|
+
end
|
21
26
|
end
|
22
27
|
end
|
23
28
|
alias_method_chain :find_routes, :filtering
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: routing-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project: "[none]"
|
140
|
-
rubygems_version: 2.4.
|
140
|
+
rubygems_version: 2.4.6
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Routing filters wraps around the complex beast that the Rails routing system
|