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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 155e4e4ff03c1905b4e940cd44a6882e44476251
4
- data.tar.gz: 54c1d04f984a69ac8d6ca3cd68b8f02fe1c92730
3
+ metadata.gz: 1ed5b0fd6b37f434639ed4dc815e078904dbbe97
4
+ data.tar.gz: 7fbc04ecd600c259d4c11418b2c26f6662396eae
5
5
  SHA512:
6
- metadata.gz: 293cb31a89bb6eb35013b2beac05cb4698ea072454bdf5afb95cf6b8817cc2855894e1967c20cfda8ca2c3991e5c3fdb324892a8961c89eb79f01879b2548c68
7
- data.tar.gz: d37b6148b8e35ada00cc2b914f3a150abb7641cd9239fc28b49b553f5c884341fba7a74af0ae926881ee1b850a4c393fec82917656a2655b4064ab466ea72492
6
+ metadata.gz: 3050e4f205b0acf5e6487c8b26c4c5a7c5c684d458f4741250bd1165a5441728a20ddfc9722e1211c99d1a95318fd14a78a1b67d4fc04f0f48ac26da25fff41f
7
+ data.tar.gz: 1634aa93348c90c23e3f259fd1dd9824953dc34ada977e88706ed331c1175b11eb9d9d133cc6c762f50a2819d1891c811278197c4b3ad7412ae6868ce23f681e
@@ -1,3 +1,7 @@
1
+ ## 0.5.1
2
+
3
+ * Handle env as Hash and object at the same time in journey overrides.
4
+
1
5
  ## 0.5.0
2
6
 
3
7
  * Rails 4.2 only support
@@ -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
- env['PATH_INFO'] = original_path # restore the original path
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
@@ -1,3 +1,3 @@
1
1
  module RoutingFilter
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
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.0
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-02-16 00:00:00.000000000 Z
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.5
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