i18n 1.7.1 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2d329752d461ff5287721f9bd5fee7f33a102562eaee86e6a9ab2cb2fbdae44
4
- data.tar.gz: 305fc47d8004f06f2589d1bccb015c772e1122c18e4328956a89833e473f6e29
3
+ metadata.gz: 1feacf530f7c7d776e429106178388b7f74a9d5dc2c56ff84f54cc69e3387f9d
4
+ data.tar.gz: b718873f023bb27b997c6bd9e57711c61867aa011db33bab0c92c6863d2c6852
5
5
  SHA512:
6
- metadata.gz: 16bc9ad463daaea66200aac4eade44ab199cdd4cf29e0a2d0eb0de3230ceee005d67aaa03459e2f364d1638d2cc6e9f3f8b378f7f0b6cff685f88e66044d9f1a
7
- data.tar.gz: 157350c5f080cb7fc1ba074411c06d364332d66e2e23f512f1a263fcf9e23ff309f2e696da582862effd9d22a9207c8f6191fbaf5806c3f94ab1b212e5630c00
6
+ metadata.gz: f50c1c99b2582d6fb03e6c6782c8213e2b52e2ef1f12dd91880cf33d1458f3b24b898189cf684070bfe4c6bc268ee2d1523fb0bc966d737ffbfbcc32dddc30c3
7
+ data.tar.gz: c7e8e494a4c9d379f378fd6dda2320052b5be3c2ada7596ea32ba91535c491aa4581aaac1c7e672920fe5e4c70bfeaee872c7ef89b0e57791ca108077a397609
@@ -101,8 +101,7 @@ module I18n
101
101
  init_translations unless initialized?
102
102
  translations
103
103
  end
104
-
105
- memo.deep_merge!(partial_translations)
104
+ memo.deep_merge!(partial_translations) { |_, a, b| b || a }
106
105
  end
107
106
  end
108
107
 
@@ -18,12 +18,18 @@ module I18n
18
18
  end
19
19
  end
20
20
 
21
- # deep_merge_hash! by Stefan Rusterholz, see http://www.ruby-forum.com/topic/142809
22
- def deep_merge!(data)
23
- merger = lambda do |_key, v1, v2|
24
- Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2
21
+ # deep_merge! from activesupport 5
22
+ # Copyright (c) 2005-2019 David Heinemeier Hansson
23
+ def deep_merge!(other_hash, &block)
24
+ merge!(other_hash) do |key, this_val, other_val|
25
+ if this_val.is_a?(Hash) && other_val.is_a?(Hash)
26
+ this_val.deep_merge(other_val, &block)
27
+ elsif block_given?
28
+ block.call(key, this_val, other_val)
29
+ else
30
+ other_val
31
+ end
25
32
  end
26
- merge!(data, &merger)
27
33
  end
28
34
 
29
35
  def symbolize_key(key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18n
4
- VERSION = "1.7.1"
4
+ VERSION = "1.8.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2020-01-07 00:00:00.000000000 Z
16
+ date: 2020-01-09 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: concurrent-ruby