getaround_utils 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8229adb825c1d60f82dbf661e85bf31088640c7d1260d63993b95b674939817
4
- data.tar.gz: ae12f1034bf7efbf90a8d206fd298e0eb23b2e356f6be713e64068d65bcd69cc
3
+ metadata.gz: 5613ee79100a9cded2aa604fa57fc13ecf8c2fb7dbf14cbaa80cb76d6c2c6359
4
+ data.tar.gz: 421141ea846ad8a21ea03e635f3f95b2e7395a60db7b25b732cf8ca8187b8fbd
5
5
  SHA512:
6
- metadata.gz: '09415cfd824c79234e662ce02ca9195ef330a6ed52e64035d0d596856ffb3d76d84dcb8d27ac8670ac2c03be87bdff7f946f6d34703ea6ddafbd7b64fbf89e94'
7
- data.tar.gz: d343fe8e41a279794644f5cf386380691af2ad3ab6c0e9d48056726ee96dacf3103c9c865d1a9fbb14c955fd721bcffd721cfc930cb15b8c2e66f215612a567c
6
+ metadata.gz: f294d961b827ba51b7c3d90ee33a7a042d9f7d5cbfbf406509d3b94455e444c88f1df7a656151a67caa676ef8dde60bfe41454295c4b3b12306d52a66f71ec5f
7
+ data.tar.gz: 9b94144e4ad1325e9c80ace4c099c00dd2592edef3ac9bb1269ead9811a77c0cf54f55cceb1d7c5a10bab2b7d1c7033ec5b4bf9d63075ac1102ba597f6ac3daa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [0.3.2] 2026-02-27
2
+ - Add `GetaroundUtils::I18nBackend::FlatKeys` an I18n backend that supports flatten keys
3
+
1
4
  ## [0.3.1] 2026-02-18
2
5
  - In `GetaroundUtils::Engines::Health` ignore Heroku, add ArgoCD
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- getaround_utils (0.3.1)
4
+ getaround_utils (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support"
4
+ require 'i18n/backend/transliterator'
5
+ require "i18n/backend/simple"
6
+
7
+ module GetaroundUtils; end
8
+ module GetaroundUtils::I18nBackend; end
9
+
10
+ class GetaroundUtils::I18nBackend::FlatKeys < I18n::Backend::Simple
11
+ def store_translations(locale, data, options = {})
12
+ expanded = expand_dot_keys(data)
13
+ super(locale, expanded, options)
14
+ end
15
+
16
+ private
17
+
18
+ def expand_dot_key(path, value)
19
+ if path.any?
20
+ { path.first.to_sym => expand_dot_key(path[1...], value) }
21
+ else
22
+ value
23
+ end
24
+ end
25
+
26
+ def expand_dot_keys(data)
27
+ data.each_with_object({}) do |(key, value), acc|
28
+ hash = expand_dot_key([*key.to_s.split(".")], value)
29
+ acc.deep_merge!(hash)
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GetaroundUtils
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getaround_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drivy
@@ -209,6 +209,7 @@ files:
209
209
  - lib/getaround_utils.rb
210
210
  - lib/getaround_utils/engines.rb
211
211
  - lib/getaround_utils/engines/health.rb
212
+ - lib/getaround_utils/i18n_backend/flat_keys.rb
212
213
  - lib/getaround_utils/mixins.rb
213
214
  - lib/getaround_utils/mixins/loggable.rb
214
215
  - lib/getaround_utils/ougai.rb