route_translator 12.1.0 → 13.0.0

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
  SHA256:
3
- metadata.gz: a133d7f79f6b9cd2d4c90befd935682017c4aaae32f51d3783ce9dd5d98ec5b3
4
- data.tar.gz: 9d19c7e5ef143b1b52531410014f73240a2015f0e59d26934db4da287ae3c67d
3
+ metadata.gz: 2ed12e648ee1182125c8c2348fdecb75ac6e61b6f5dbb6a8d5ab2c41bfbf2992
4
+ data.tar.gz: 9ca7e205c7ce45931322ac69e388bc35a8a8ed4866277a512c8acfe10087e7b1
5
5
  SHA512:
6
- metadata.gz: 35a66ef44e1a9a80a91d0ef84d28c200091b6840b5a4f6cad524b85c10910776781987ae1fbc2ccb1f32970e7c7abfdbb22a10ba60605c023abee2a6bbc8c753
7
- data.tar.gz: 02c6fa219f1c92e95468e4efb241f393fb5abbef057cf92e715fe1d73ad9d5f65b6a3bdc1b8e64ca5b7ed7a0c9ba29f225c27ab24ea5309670f393f0623c89ab
6
+ metadata.gz: f12fa98cbb77cb37837df68921bfda3be3a7672f1cdf60cdc3d0638e94030e1408645c9fc012d9aa00b7ef52ccdc9cc0ee5a10d116f3dcfa616b0d53acf09583
7
+ data.tar.gz: 80444879f58a98abbbb257699d2f9e2d072526276e02d25fda83df929eea5c16aeb203fcb5d25a85586ff76ab9818afc1da14b6822eeee3836f6c7112b868eab
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 13.0.0 / 2022-09-01
4
+
5
+ * [FEATURE] Replace Addressable gem with `URI::DEFAULT_PARSER` ([#268](https://github.com/enriclluelles/route_translator/pull/234))
6
+ * [FEATURE] Drop Ruby 2.5 support ([#270](https://github.com/enriclluelles/route_translator/pull/270))
7
+ * [ENHANCEMENT] Update development dependencies
8
+
3
9
  ## 12.1.0 / 2021-12-20
4
10
 
5
11
  * [FEATURE] Add Rails 7.0 compatibility
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2007 Raul Murciano [http://raul.murciano.net], Domestika INTERNET S.L. [http://domestika.org], 2015 Enric Lluelles [http://enric.lluell.es], 2021 Geremia Taglialatela
3
+ Copyright (c) 2007 Raul Murciano [http://raul.murciano.net], Domestika INTERNET S.L. [http://domestika.org], 2015 Enric Lluelles [http://enric.lluell.es], 2022 Geremia Taglialatela
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -354,6 +354,23 @@ people_products_favourites_es GET /people/products/fans(.:format) people/
354
354
  products_favourites_es GET /products/favoritos(.:format) products#favourites {:locale=>"es"}
355
355
  ```
356
356
 
357
+ It is also possible to translated resources scoped into a namespace. Example:
358
+
359
+ ```yml
360
+ es:
361
+ routes:
362
+ controllers:
363
+ people:
364
+ products:
365
+ products: productos_favoritos
366
+ ```
367
+
368
+ Routes will be translated as in:
369
+
370
+ ```
371
+ people_products_es GET /people/productos_favoritos(.:format) people/products#index {:locale=>"es"}
372
+ ```
373
+
357
374
  The gem will lookup translations under `controllers` scope first and then lookup translations under `routes` scope.
358
375
 
359
376
 
@@ -24,7 +24,7 @@ end
24
24
 
25
25
  ActiveSupport.on_load(:action_controller) do
26
26
  include RouteTranslator::Controller
27
- if ENV['RAILS_ENV'] == 'test'
27
+ if ENV.fetch('RAILS_ENV', nil) == 'test'
28
28
  require 'route_translator/extensions/test_case'
29
29
  ActionController::TestCase.include RouteTranslator::TestCase
30
30
  end
@@ -34,7 +34,7 @@ module RouteTranslator
34
34
  def translate_string(str, locale, scope)
35
35
  translated_resource = translate_resource(str, locale.to_s, scope)
36
36
 
37
- Addressable::URI.normalize_component translated_resource
37
+ URI::DEFAULT_PARSER.escape translated_resource
38
38
  end
39
39
  end
40
40
 
@@ -35,7 +35,7 @@ module RouteTranslator
35
35
  __send__(Translator.route_name_for(args, old_name, suffix, self), *args)
36
36
  end
37
37
 
38
- add_helpers_to_test_cases(helper_container) if ENV['RAILS_ENV'] == 'test'
38
+ add_helpers_to_test_cases(helper_container) if ENV.fetch('RAILS_ENV', nil) == 'test'
39
39
  end
40
40
  end
41
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RouteTranslator
4
- VERSION = '12.1.0'
4
+ VERSION = '13.0.0'
5
5
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support'
4
- require 'addressable/uri'
5
4
 
6
5
  require 'route_translator/extensions'
7
6
  require 'route_translator/translator'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: route_translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-12-20 00:00:00.000000000 Z
13
+ date: 2022-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "<"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '7.1'
55
- - !ruby/object:Gem::Dependency
56
- name: addressable
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '2.7'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '2.7'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: appraisal
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -223,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
209
  requirements:
224
210
  - - ">="
225
211
  - !ruby/object:Gem::Version
226
- version: '2.5'
212
+ version: '2.6'
227
213
  required_rubygems_version: !ruby/object:Gem::Requirement
228
214
  requirements:
229
215
  - - ">="
230
216
  - !ruby/object:Gem::Version
231
217
  version: '0'
232
218
  requirements: []
233
- rubygems_version: 3.1.6
219
+ rubygems_version: 3.3.12
234
220
  signing_key:
235
221
  specification_version: 4
236
222
  summary: Translate your Rails routes in a simple manner