brew vendor-gems: commit updates.

This commit is contained in:
BrewTestBot 2023-02-24 19:00:52 +00:00
parent ddb4229df3
commit e7980e9fb5
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
120 changed files with 48 additions and 44 deletions

View File

@ -23,7 +23,7 @@ kernel = (class << ::Kernel; self; end)
k.send(:private, :require) if private_require k.send(:private, :require) if private_require
end end
end end
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.2.0/lib/concurrent-ruby") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.2.1/lib/concurrent-ruby")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/i18n-1.12.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/i18n-1.12.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.17.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.17.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tzinfo-2.0.6/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tzinfo-2.0.6/lib")

View File

@ -1,3 +1,4 @@
require 'fiber'
require 'concurrent/utility/engine' require 'concurrent/utility/engine'
require 'concurrent/constants' require 'concurrent/constants'

View File

@ -9,8 +9,8 @@ module Concurrent
# @!visibility private # @!visibility private
class MriMapBackend < NonConcurrentMapBackend class MriMapBackend < NonConcurrentMapBackend
def initialize(options = nil) def initialize(options = nil, &default_proc)
super(options) super(options, &default_proc)
@write_lock = Mutex.new @write_lock = Mutex.new
end end

View File

@ -12,8 +12,10 @@ module Concurrent
# directly without calling each other. This is important because of the # directly without calling each other. This is important because of the
# SynchronizedMapBackend which uses a non-reentrant mutex for performance # SynchronizedMapBackend which uses a non-reentrant mutex for performance
# reasons. # reasons.
def initialize(options = nil) def initialize(options = nil, &default_proc)
@backend = {} validate_options_hash!(options) if options.kind_of?(::Hash)
@backend = Hash.new(&default_proc)
@default_proc = default_proc
end end
def [](key) def [](key)
@ -55,7 +57,7 @@ module Concurrent
end end
def compute(key) def compute(key)
store_computed_value(key, yield(@backend[key])) store_computed_value(key, yield(get_or_default(key, nil)))
end end
def merge_pair(key, value) def merge_pair(key, value)
@ -67,7 +69,7 @@ module Concurrent
end end
def get_and_set(key, value) def get_and_set(key, value)
stored_value = @backend[key] stored_value = get_or_default(key, nil)
@backend[key] = value @backend[key] = value
stored_value stored_value
end end
@ -109,13 +111,11 @@ module Concurrent
@backend.fetch(key, default_value) @backend.fetch(key, default_value)
end end
alias_method :_get, :[]
alias_method :_set, :[]=
private :_get, :_set
private private
def initialize_copy(other) def initialize_copy(other)
super super
@backend = {} @backend = Hash.new(&@default_proc)
self self
end end

View File

@ -46,6 +46,12 @@ module Concurrent
# @note Atomic methods taking a block do not allow the `self` instance # @note Atomic methods taking a block do not allow the `self` instance
# to be used within the block. Doing so will cause a deadlock. # to be used within the block. Doing so will cause a deadlock.
# @!method []=(key, value)
# Set a value with key
# @param [Object] key
# @param [Object] value
# @return [Object] the new value
# @!method compute_if_absent(key) # @!method compute_if_absent(key)
# Compute and store new value for key if the key is absent. # Compute and store new value for key if the key is absent.
# @param [Object] key # @param [Object] key
@ -119,8 +125,12 @@ module Concurrent
# @return [true, false] true if deleted # @return [true, false] true if deleted
# @!macro map.atomic_method # @!macro map.atomic_method
# # NonConcurrentMapBackend handles default_proc natively
def initialize(options = nil, &block) unless defined?(Collection::NonConcurrentMapBackend) and self < Collection::NonConcurrentMapBackend
# @param [Hash, nil] options options to set the :initial_capacity or :load_factor. Ignored on some Rubies.
# @param [Proc] default_proc Optional block to compute the default value if the key is not set, like `Hash#default_proc`
def initialize(options = nil, &default_proc)
if options.kind_of?(::Hash) if options.kind_of?(::Hash)
validate_options_hash!(options) validate_options_hash!(options)
else else
@ -128,7 +138,7 @@ module Concurrent
end end
super(options) super(options)
@default_proc = block @default_proc = default_proc
end end
# Get a value with key # Get a value with key
@ -147,13 +157,6 @@ module Concurrent
value value
end end
end end
# Set a value with key
# @param [Object] key
# @param [Object] value
# @return [Object] the new value
def []=(key, value)
super
end end
alias_method :get, :[] alias_method :get, :[]

Some files were not shown because too many files have changed in this diff Show More