Merge pull request #8008 from Homebrew/dependabot/bundler/Library/Homebrew/zeitwerk-2.4.0

build(deps): bump zeitwerk from 2.3.1 to 2.4.0 in /Library/Homebrew
This commit is contained in:
Jonathan Chang 2020-07-15 17:58:22 +10:00 committed by GitHub
commit 1663304bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 23 additions and 12 deletions

View File

@ -110,7 +110,7 @@ GEM
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
webrobots (0.1.2)
zeitwerk (2.3.1)
zeitwerk (2.4.0)
PLATFORMS
ruby

View File

@ -8,7 +8,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.8.3/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.14.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thread_safe-0.3.6/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-1.2.7/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.3.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.4.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-6.0.3.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ast-2.4.1/lib"
$:.unshift "#{path}/"
@ -20,7 +20,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/json-2.3.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/docile-1.3.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-0.18.5/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/codecov-0.1.19/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/codecov-0.2.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/connection_pool-2.2.3/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/diff-lcs-1.4.4/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/unf_ext-0.0.7.7"
@ -62,7 +62,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-0.1.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.7.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.87.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.88.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.7.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.42.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"

View File

@ -15,7 +15,7 @@ module Zeitwerk
# @param _abspath [String]
# @return [String]
def camelize(basename, _abspath)
overrides[basename] || basename.split('_').map!(&:capitalize).join
overrides[basename] || basename.split('_').each(&:capitalize!).join
end
# Configures hard-coded inflections:

View File

@ -190,13 +190,19 @@ module Zeitwerk
# or descendants.
#
# @param path [<String, Pathname>]
# @param namespace [Class, Module]
# @raise [Zeitwerk::Error]
# @return [void]
def push_dir(path)
def push_dir(path, namespace: Object)
# Note that Class < Module.
unless namespace.is_a?(Module)
raise Error, "#{namespace.inspect} is not a class or module object, should be"
end
abspath = File.expand_path(path)
if dir?(abspath)
raise_if_conflicting_directory(abspath)
root_dirs[abspath] = true
root_dirs[abspath] = namespace
else
raise Error, "the root directory #{abspath} does not exist"
end
@ -268,7 +274,9 @@ module Zeitwerk
mutex.synchronize do
break if @setup
actual_root_dirs.each { |root_dir| set_autoloads_in_dir(root_dir, Object) }
actual_root_dirs.each do |root_dir, namespace|
set_autoloads_in_dir(root_dir, namespace)
end
do_preload
@setup = true
@ -368,8 +376,11 @@ module Zeitwerk
mutex.synchronize do
break if @eager_loaded
queue = actual_root_dirs.reject { |dir| eager_load_exclusions.member?(dir) }
queue.map! { |dir| [Object, dir] }
queue = []
actual_root_dirs.each do |root_dir, namespace|
queue << [namespace, root_dir] unless eager_load_exclusions.member?(root_dir)
end
while to_eager_load = queue.shift
namespace, dir = to_eager_load
@ -498,7 +509,7 @@ module Zeitwerk
# @return [<String>]
def actual_root_dirs
root_dirs.keys.delete_if do |root_dir|
root_dirs.reject do |root_dir, _namespace|
!dir?(root_dir) || ignored_paths.member?(root_dir)
end
end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Zeitwerk
VERSION = "2.3.1"
VERSION = "2.4.0"
end