lib/dry/schema/messages/yaml.rb in dry-schema-1.12.0 vs lib/dry/schema/messages/yaml.rb in dry-schema-1.13.0

- old
+ new

@@ -68,11 +68,13 @@ end # rubocop: enable Metrics/PerceivedComplexity # @api private def self.cache - @cache ||= Concurrent::Map.new { |h, k| h[k] = Concurrent::Map.new } + @cache ||= Concurrent::Map.new do |h, k| + h.compute_if_absent(k) { Concurrent::Map.new } + end end # @api private def self.source_cache @source_cache ||= Concurrent::Map.new @@ -80,10 +82,10 @@ # @api private def initialize(data: EMPTY_HASH, config: nil) super() @data = data - @config = config if config + @__config__ = config if config @t = proc { |key, locale: default_locale| get("%<locale>s.#{key}", locale: locale) } end # Get an array of looked up paths #