diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 3087219698..72bec8a247 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -33,7 +33,7 @@ GEM hpricot (0.8.6) http-cookie (1.0.4) domain_name (~> 0.5) - i18n (1.9.0) + i18n (1.8.11) concurrent-ruby (~> 1.0) json_schemer (0.2.18) ecma-re-validator (~> 0.3) diff --git a/Library/Homebrew/sorbet/rbi/gems/i18n@1.9.0.rbi b/Library/Homebrew/sorbet/rbi/gems/i18n@1.8.11.rbi similarity index 91% rename from Library/Homebrew/sorbet/rbi/gems/i18n@1.9.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/i18n@1.8.11.rbi index 76d3cd238d..abd5748f7c 100644 --- a/Library/Homebrew/sorbet/rbi/gems/i18n@1.9.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/i18n@1.8.11.rbi @@ -8,20 +8,9 @@ module I18n extend ::I18n::Base class << self - def cache_key_digest; end - def cache_key_digest=(key_digest); end - def cache_namespace; end - def cache_namespace=(namespace); end - def cache_store; end - def cache_store=(store); end - def fallbacks; end - def fallbacks=(fallbacks); end def interpolate(string, values); end def interpolate_hash(string, values); end def new_double_nested_cache; end - def perform_caching?; end - def reserve_key(key); end - def reserved_keys_pattern; end end end @@ -87,10 +76,43 @@ module I18n::Backend::Cascade def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end end +class I18n::Backend::Chain + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::Chain::Implementation +end + +module I18n::Backend::Chain::Implementation + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + def initialize(*backends); end + + def available_locales; end + def backends; end + def backends=(_arg0); end + def eager_load!; end + def exists?(locale, key, options = T.unsafe(nil)); end + def initialized?; end + def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end + def reload!; end + def store_translations(locale, data, options = T.unsafe(nil)); end + def translate(locale, key, default_options = T.unsafe(nil)); end + + protected + + def init_translations; end + def namespace_lookup?(result, options); end + def translations; end + + private + + def _deep_merge(hash, other_hash); end +end + module I18n::Backend::Fallbacks def exists?(locale, key, options = T.unsafe(nil)); end def extract_non_symbol_default!(options); end - def resolve(locale, object, subject, options = T.unsafe(nil)); end def translate(locale, key, options = T.unsafe(nil)); end private @@ -120,6 +142,19 @@ end I18n::Backend::Flatten::FLATTEN_SEPARATOR = T.let(T.unsafe(nil), String) I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR = T.let(T.unsafe(nil), String) +module I18n::Backend::Gettext + protected + + def load_po(filename); end + def normalize(locale, data); end + def normalize_pluralization(locale, key, value); end + def parse(filename); end +end + +class I18n::Backend::Gettext::PoData < ::Hash + def set_comment(msgid_or_sym, comment); end +end + module I18n::Backend::InterpolationCompiler def interpolate(locale, string, values); end def store_translations(locale, data, options = T.unsafe(nil)); end @@ -389,6 +424,7 @@ module I18n::Gettext::Helpers end I18n::Gettext::PLURAL_SEPARATOR = T.let(T.unsafe(nil), String) +module I18n::HashRefinements; end I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp) class I18n::InvalidLocale < ::I18n::ArgumentError @@ -420,7 +456,7 @@ class I18n::Locale::Fallbacks < ::Hash def [](locale); end def defaults; end def defaults=(defaults); end - def map(*args, &block); end + def map(mappings); end protected @@ -516,13 +552,12 @@ module I18n::MissingTranslation::Base def to_s; end end -I18n::MissingTranslation::Base::PERMITTED_KEYS = T.let(T.unsafe(nil), Array) - class I18n::MissingTranslationData < ::I18n::ArgumentError include ::I18n::MissingTranslation::Base end I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array) +I18n::RESERVED_KEYS_PATTERN = T.let(T.unsafe(nil), Regexp) class I18n::ReservedInterpolationKey < ::I18n::ArgumentError def initialize(key, string); end @@ -545,11 +580,6 @@ module I18n::Tests::Interpolation; end module I18n::Tests::Link; end module I18n::Tests::Localization - include ::I18n::Tests::Localization::Date - include ::I18n::Tests::Localization::DateTime - include ::I18n::Tests::Localization::Procs - include ::I18n::Tests::Localization::Time - class << self def included(base); end end @@ -583,17 +613,4 @@ class I18n::UnknownFileType < ::I18n::ArgumentError def type; end end -module I18n::Utils - class << self - def deep_merge(hash, other_hash, &block); end - def deep_merge!(hash, other_hash, &block); end - def deep_symbolize_keys(hash); end - def except(hash, *keys); end - - private - - def deep_symbolize_keys_in_object(value); end - end -end - I18n::VERSION = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index aeb29bccdf..79fde320b1 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -2417,6 +2417,48 @@ module Gem def self.remove_unresolved_default_spec(spec); end end +module GetText +end + +class GetText::PoParser + def _(x); end + + def _reduce_10(val, _values, result); end + + def _reduce_12(val, _values, result); end + + def _reduce_13(val, _values, result); end + + def _reduce_14(val, _values, result); end + + def _reduce_15(val, _values, result); end + + def _reduce_5(val, _values, result); end + + def _reduce_8(val, _values, result); end + + def _reduce_9(val, _values, result); end + + def _reduce_none(val, _values, result); end + + def on_comment(comment); end + + def on_message(msgid, msgstr); end + + def parse(str, data, ignore_fuzzy=T.unsafe(nil)); end + + def unescape(orig); end + Racc_arg = ::T.let(nil, ::T.untyped) + Racc_debug_parser = ::T.let(nil, ::T.untyped) + Racc_token_to_s_table = ::T.let(nil, ::T.untyped) +end + +class GetText::PoParser +end + +module GetText +end + module GitHub::API extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -2737,6 +2779,26 @@ end module HostEnvironmentSimulatorHelper end +module I18n + def self.cache_key_digest(); end + + def self.cache_key_digest=(key_digest); end + + def self.cache_namespace(); end + + def self.cache_namespace=(namespace); end + + def self.cache_store(); end + + def self.cache_store=(store); end + + def self.fallbacks(); end + + def self.fallbacks=(fallbacks); end + + def self.perform_caching?(); end +end + class IO def beep(); end @@ -4314,6 +4376,8 @@ module RSpec::Core::MockingAdapters end class RSpec::Core::OutputWrapper + def as_json(*args, &block); end + def readline_nonblock(*args, &block); end end diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 0bcfca942f..1a4b8b8143 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -4,7 +4,7 @@ ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' ruby_version = RbConfig::CONFIG["ruby_version"] path = File.expand_path('..', __FILE__) $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.9.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.8.11/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.15.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-2.0.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.5.3/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n.rb index 1b32f470d3..237bfb5e03 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n.rb @@ -4,7 +4,6 @@ require 'concurrent/map' require 'concurrent/hash' require 'i18n/version' -require 'i18n/utils' require 'i18n/exceptions' require 'i18n/interpolate/ruby' @@ -23,7 +22,6 @@ module I18n exception_handler fallback fallback_in_progress - fallback_original_locale format object raise @@ -31,26 +29,14 @@ module I18n scope separator throw - ] + ].freeze + RESERVED_KEYS_PATTERN = /%\{(#{RESERVED_KEYS.join("|")})\}/ EMPTY_HASH = {}.freeze def self.new_double_nested_cache # :nodoc: Concurrent::Map.new { |h, k| h[k] = Concurrent::Map.new } end - # Marks a key as reserved. Reserved keys are used internally, - # and can't also be used for interpolation. If you are using any - # extra keys as I18n options, you should call I18n.reserve_key - # before any I18n.translate (etc) calls are made. - def self.reserve_key(key) - RESERVED_KEYS << key.to_sym - @reserved_keys_pattern = nil - end - - def self.reserved_keys_pattern # :nodoc: - @reserved_keys_pattern ||= /%\{(#{RESERVED_KEYS.join("|")})\}/ - end - module Base # Gets I18n configuration object. def config @@ -274,14 +260,14 @@ module I18n # # Setting a Hash using Ruby: # - # store_translations(:de, i18n: { - # transliterate: { - # rule: { - # 'ü' => 'ue', - # 'ö' => 'oe' - # } - # } - # }) + # store_translations(:de, :i18n => { + # :transliterate => { + # :rule => { + # "ü" => "ue", + # "ö" => "oe" + # } + # } + # ) # # Setting a Proc: # @@ -410,7 +396,7 @@ module I18n keys.delete('') keys.map! do |k| case k - when /\A[-+]?([1-9]\d*|0)\z/ # integer + when /\A[-+]?[1-9]\d*\z/ # integer k.to_i when 'true' true diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/base.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/base.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/base.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/base.rb index b78a6af1a3..e7b952726f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/base.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/base.rb @@ -2,10 +2,12 @@ require 'yaml' require 'json' +require 'i18n/core_ext/hash' module I18n module Backend module Base + using I18n::HashRefinements include I18n::Backend::Transliterator # Accepts a list of paths to translation files. Loads translations from @@ -51,7 +53,7 @@ module I18n end deep_interpolation = options[:deep_interpolation] - values = Utils.except(options, *RESERVED_KEYS) + values = options.except(*RESERVED_KEYS) if values entry = if deep_interpolation deep_interpolate(locale, entry, values) @@ -221,18 +223,17 @@ module I18n def load_file(filename) type = File.extname(filename).tr('.', '').downcase raise UnknownFileType.new(type, filename) unless respond_to?(:"load_#{type}", true) - data, keys_symbolized = send(:"load_#{type}", filename) + data = send(:"load_#{type}", filename) unless data.is_a?(Hash) raise InvalidLocaleData.new(filename, 'expects it to return a hash, but does not') end - data.each { |locale, d| store_translations(locale, d || {}, skip_symbolize_keys: keys_symbolized) } + data.each { |locale, d| store_translations(locale, d || {}) } end # Loads a plain Ruby translations file. eval'ing the file must yield # a Hash containing translation data with locales as toplevel keys. def load_rb(filename) - translations = eval(IO.read(filename), binding, filename) - [translations, false] + eval(IO.read(filename), binding, filename) end # Loads a YAML translations file. The data must have locales as @@ -240,9 +241,9 @@ module I18n def load_yml(filename) begin if YAML.respond_to?(:unsafe_load_file) # Psych 4.0 way - [YAML.unsafe_load_file(filename, symbolize_names: true, freeze: true), true] + YAML.unsafe_load_file(filename) else - [YAML.load_file(filename), false] + YAML.load_file(filename) end rescue TypeError, ScriptError, StandardError => e raise InvalidLocaleData.new(filename, e.inspect) @@ -254,12 +255,7 @@ module I18n # toplevel keys. def load_json(filename) begin - # Use #load_file as a proxy for a version of JSON where symbolize_names and freeze are supported. - if ::JSON.respond_to?(:load_file) - [::JSON.load_file(filename, symbolize_names: true, freeze: true), true] - else - [::JSON.parse(File.read(filename)), false] - end + ::JSON.parse(File.read(filename)) rescue TypeError, StandardError => e raise InvalidLocaleData.new(filename, e.inspect) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/cache.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/cache.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/cache.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/cache.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/cache_file.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/cache_file.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/cache_file.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/cache_file.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/cascade.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/cascade.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/cascade.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/cascade.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/chain.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/chain.rb index 2d9d8ff385..9ab857536f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/chain.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/chain.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'i18n/core_ext/hash' - module I18n module Backend # Backend that chains multiple other backends and checks each of them when @@ -19,6 +17,8 @@ module I18n # The implementation assumes that all backends added to the Chain implement # a lookup method with the same API as Simple backend does. class Chain + using I18n::HashRefinements + module Implementation include Base @@ -55,7 +55,7 @@ module I18n def translate(locale, key, default_options = EMPTY_HASH) namespace = nil - options = Utils.except(default_options, :default) + options = default_options.except(:default) backends.each do |backend| catch(:exception) do @@ -101,7 +101,7 @@ module I18n init_translations unless initialized? translations end - Utils.deep_merge!(memo, partial_translations) { |_, a, b| b || a } + memo.deep_merge!(partial_translations) { |_, a, b| b || a } end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/fallbacks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/fallbacks.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/fallbacks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/fallbacks.rb index acab6dfec6..1acdbd68f8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/fallbacks.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/fallbacks.rb @@ -43,7 +43,7 @@ module I18n return super if options[:fallback_in_progress] default = extract_non_symbol_default!(options) if options[:default] - fallback_options = options.merge(:fallback_in_progress => true, fallback_original_locale: locale) + fallback_options = options.merge(:fallback_in_progress => true) I18n.fallbacks[locale].each do |fallback| begin catch(:exception) do @@ -64,17 +64,6 @@ module I18n throw(:exception, I18n::MissingTranslation.new(locale, key, options)) end - def resolve(locale, object, subject, options = EMPTY_HASH) - return subject if options[:resolve] == false - return super unless subject.is_a?(Symbol) - - result = catch(:exception) do - options.delete(:fallback_in_progress) - I18n.translate(subject, **options.merge(locale: options[:fallback_original_locale], throw: true)) - end - result unless result.is_a?(MissingTranslation) - end - def extract_non_symbol_default!(options) defaults = [options[:default]].flatten first_non_symbol_default = defaults.detect{|default| !default.is_a?(Symbol)} diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/flatten.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/flatten.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/flatten.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/flatten.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/gettext.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/gettext.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/gettext.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/gettext.rb index 50d85805f7..72d20f06e7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/gettext.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/gettext.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'i18n/core_ext/hash' require 'i18n/gettext' require 'i18n/gettext/po_parser' @@ -32,6 +31,8 @@ module I18n # Without it strings containing periods (".") will not be translated. module Gettext + using I18n::HashRefinements + class PoData < Hash def set_comment(msgid_or_sym, comment) # ignore @@ -42,7 +43,7 @@ module I18n def load_po(filename) locale = ::File.basename(filename, '.po').to_sym data = normalize(locale, parse(filename)) - [{ locale => data }, false] + { locale => data } end def parse(filename) @@ -60,7 +61,7 @@ module I18n { part => _normalized.empty? ? value : _normalized } end - Utils.deep_merge!(result, normalized) + result.deep_merge!(normalized) end result end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/interpolation_compiler.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/interpolation_compiler.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/interpolation_compiler.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/interpolation_compiler.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/key_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/key_value.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/key_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/key_value.rb index b937e253a8..e391672b47 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/key_value.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/key_value.rb @@ -67,6 +67,8 @@ module I18n # # This is useful if you are using a KeyValue backend chained to a Simple backend. class KeyValue + using I18n::HashRefinements + module Implementation attr_accessor :store @@ -89,7 +91,7 @@ module I18n when Hash if @subtrees && (old_value = @store[key]) old_value = JSON.decode(old_value) - value = Utils.deep_merge!(Utils.deep_symbolize_keys(old_value), value) if old_value.is_a?(Hash) + value = old_value.deep_symbolize_keys.deep_merge!(value) if old_value.is_a?(Hash) end when Proc raise "Key-value stores cannot handle procs" @@ -113,12 +115,12 @@ module I18n # them into a hash such as the one returned from loading the # haml files def translations - @translations = Utils.deep_symbolize_keys(@store.keys.clone.map do |main_key| + @translations = @store.keys.clone.map do |main_key| main_value = JSON.decode(@store[main_key]) main_key.to_s.split(".").reverse.inject(main_value) do |value, key| {key.to_sym => value} end - end.inject{|hash, elem| Utils.deep_merge!(hash, elem)}) + end.inject{|hash, elem| hash.deep_merge!(elem)}.deep_symbolize_keys end def init_translations @@ -139,7 +141,7 @@ module I18n value = JSON.decode(value) if value if value.is_a?(Hash) - Utils.deep_symbolize_keys(value) + value.deep_symbolize_keys elsif !value.nil? value elsif !@subtrees diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/memoize.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/memoize.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/memoize.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/memoize.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/metadata.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/metadata.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/metadata.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/metadata.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/pluralization.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/pluralization.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/pluralization.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/pluralization.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/simple.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/simple.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/simple.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/simple.rb index 687c115413..0dde82d76a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/simple.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/simple.rb @@ -19,6 +19,8 @@ module I18n # # I18n::Backend::Simple.include(I18n::Backend::Pluralization) class Simple + using I18n::HashRefinements + module Implementation include Base @@ -38,8 +40,8 @@ module I18n end locale = locale.to_sym translations[locale] ||= Concurrent::Hash.new - data = Utils.deep_symbolize_keys(data) unless options.fetch(:skip_symbolize_keys, false) - Utils.deep_merge!(translations[locale], data) + data = data.deep_symbolize_keys + translations[locale].deep_merge!(data) end # Get available locales from the translations hash diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/transliterator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/transliterator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/backend/transliterator.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/backend/transliterator.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/config.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/config.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/config.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/config.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/core_ext/hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/core_ext/hash.rb new file mode 100644 index 0000000000..e022e84234 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/core_ext/hash.rb @@ -0,0 +1,59 @@ +module I18n + module HashRefinements + refine Hash do + using I18n::HashRefinements + def except(*keys) + dup.except!(*keys) + end unless method_defined?(:except) + + def except!(*keys) + keys.each { |key| delete(key) } + self + end + + def deep_symbolize_keys + each_with_object({}) do |(key, value), result| + result[symbolize_key(key)] = deep_symbolize_keys_in_object(value) + result + end + end + + # deep_merge from activesupport 5 + # Copyright (c) 2005-2019 David Heinemeier Hansson + def deep_merge(other_hash, &block) + dup.deep_merge!(other_hash, &block) + end + + # deep_merge! from activesupport 5 + # Copyright (c) 2005-2019 David Heinemeier Hansson + def deep_merge!(other_hash, &block) + merge!(other_hash) do |key, this_val, other_val| + if this_val.is_a?(Hash) && other_val.is_a?(Hash) + this_val.deep_merge(other_val, &block) + elsif block_given? + block.call(key, this_val, other_val) + else + other_val + end + end + end + + def symbolize_key(key) + key.respond_to?(:to_sym) ? key.to_sym : key + end + + private + + def deep_symbolize_keys_in_object(value) + case value + when Hash + value.deep_symbolize_keys + when Array + value.map { |e| deep_symbolize_keys_in_object(e) } + else + value + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/exceptions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/exceptions.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/exceptions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/exceptions.rb index 212a9039e2..74b3d34efb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/exceptions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/exceptions.rb @@ -47,12 +47,10 @@ module I18n class MissingTranslation < ArgumentError module Base - PERMITTED_KEYS = [:scope].freeze - attr_reader :locale, :key, :options def initialize(locale, key, options = EMPTY_HASH) - @key, @locale, @options = key, locale, options.slice(*PERMITTED_KEYS) + @key, @locale, @options = key, locale, options.dup options.each { |k, v| self.options[k] = v.inspect if v.is_a?(Proc) } end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/gettext.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/gettext.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/gettext.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/gettext.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/gettext/helpers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/gettext/helpers.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/gettext/helpers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/gettext/helpers.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/gettext/po_parser.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/gettext/po_parser.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/gettext/po_parser.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/gettext/po_parser.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/interpolate/ruby.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/interpolate/ruby.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/interpolate/ruby.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/interpolate/ruby.rb index dab8f0ed32..13171d30a3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/interpolate/ruby.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/interpolate/ruby.rb @@ -5,7 +5,7 @@ module I18n DEFAULT_INTERPOLATION_PATTERNS = [ /%%/, /%\{([\w|]+)\}/, # matches placeholders like "%{foo} or %{foo|word}" - /%<(\w+)>([^\d]*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%.d" + /%<(\w+)>(.*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%.d" ].freeze INTERPOLATION_PATTERN = Regexp.union(DEFAULT_INTERPOLATION_PATTERNS) deprecate_constant :INTERPOLATION_PATTERN @@ -14,7 +14,7 @@ module I18n # Return String or raises MissingInterpolationArgument exception. # Missing argument's logic is handled by I18n.config.missing_interpolation_argument_handler. def interpolate(string, values) - raise ReservedInterpolationKey.new($1.to_sym, string) if string =~ I18n.reserved_keys_pattern + raise ReservedInterpolationKey.new($1.to_sym, string) if string =~ RESERVED_KEYS_PATTERN raise ArgumentError.new('Interpolation values must be a Hash.') unless values.kind_of?(Hash) interpolate_hash(string, values) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/fallbacks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/fallbacks.rb similarity index 84% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/fallbacks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/fallbacks.rb index e30acc4340..9967ff3475 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/fallbacks.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/fallbacks.rb @@ -15,12 +15,19 @@ # * all parent locales of a given locale (e.g. :es for :"es-MX") first, # * the current default locales and all of their parents second # -# The default locales are set to [] by default but can be set to something else. +# The default locales are set to [I18n.default_locale] by default but can be +# set to something else. # # One can additionally add any number of additional fallback locales manually. # These will be added before the default locales to the fallback chain. For # example: # +# # using the default locale as default fallback locale +# +# I18n.default_locale = :"en-US" +# I18n.fallbacks = I18n::Locale::Fallbacks.new(:"de-AT" => :"de-DE") +# I18n.fallbacks[:"de-AT"] # => [:"de-AT", :de, :"de-DE"] +# # # using a custom locale as default fallback locale # # I18n.fallbacks = I18n::Locale::Fallbacks.new(:"en-GB", :"de-AT" => :de, :"de-CH" => :de) @@ -64,18 +71,13 @@ module I18n super || store(locale, compute(locale)) end - def map(*args, &block) - if args.count == 1 && !block_given? - mappings = args.first - mappings.each do |from, to| - from, to = from.to_sym, Array(to) - to.each do |_to| - @map[from] ||= [] - @map[from] << _to.to_sym - end + def map(mappings) + mappings.each do |from, to| + from, to = from.to_sym, Array(to) + to.each do |_to| + @map[from] ||= [] + @map[from] << _to.to_sym end - else - @map.map(*args, &block) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag/parents.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/parents.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag/parents.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/parents.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag/rfc4646.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/rfc4646.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag/rfc4646.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/rfc4646.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag/simple.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/locale/tag/simple.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/locale/tag/simple.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/middleware.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/middleware.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/middleware.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/middleware.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/version.rb similarity index 69% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/version.rb index 9d1b5e2104..2c90302c04 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.11/lib/i18n/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module I18n - VERSION = "1.9.0" + VERSION = "1.8.11" end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/utils.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/utils.rb deleted file mode 100644 index 88415615f2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.9.0/lib/i18n/utils.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -module I18n - module Utils - class << self - if Hash.method_defined?(:except) - def except(hash, *keys) - hash.except(*keys) - end - else - def except(hash, *keys) - hash = hash.dup - keys.each { |k| hash.delete(k) } - hash - end - end - - def deep_merge(hash, other_hash, &block) - deep_merge!(hash.dup, other_hash, &block) - end - - def deep_merge!(hash, other_hash, &block) - hash.merge!(other_hash) do |key, this_val, other_val| - if this_val.is_a?(Hash) && other_val.is_a?(Hash) - deep_merge(this_val, other_val, &block) - elsif block_given? - yield key, this_val, other_val - else - other_val - end - end - end - - def deep_symbolize_keys(hash) - hash.each_with_object({}) do |(key, value), result| - result[key.respond_to?(:to_sym) ? key.to_sym : key] = deep_symbolize_keys_in_object(value) - result - end - end - - private - - def deep_symbolize_keys_in_object(value) - case value - when Hash - deep_symbolize_keys(value) - when Array - value.map { |e| deep_symbolize_keys_in_object(e) } - else - value - end - end - end - end -end