From 2f5c0d2299066257fe61c12edc6c355d5cf5d746 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 18:57:59 +0000 Subject: [PATCH 1/3] build(deps): bump zeitwerk from 2.6.6 to 2.6.7 in /Library/Homebrew Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.6.6 to 2.6.7. - [Release notes](https://github.com/fxn/zeitwerk/releases) - [Changelog](https://github.com/fxn/zeitwerk/blob/main/CHANGELOG.md) - [Commits](https://github.com/fxn/zeitwerk/compare/v2.6.6...v2.6.7) --- updated-dependencies: - dependency-name: zeitwerk dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 30f09d8bb6..f0ea94b04e 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -215,7 +215,7 @@ GEM yard-sorbet (0.6.1) sorbet-runtime (>= 0.5) yard (>= 0.9) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS aarch64-linux From 4454db9ed925bb774832d2e660a82679f8f15bc2 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Fri, 10 Feb 2023 19:02:23 +0000 Subject: [PATCH 2/3] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../lib/zeitwerk.rb | 0 .../lib/zeitwerk/error.rb | 0 .../lib/zeitwerk/explicit_namespace.rb | 7 ++ .../lib/zeitwerk/gem_inflector.rb | 0 .../lib/zeitwerk/gem_loader.rb | 0 .../lib/zeitwerk/inflector.rb | 0 .../lib/zeitwerk/internal.rb | 0 .../lib/zeitwerk/kernel.rb | 0 .../lib/zeitwerk/loader.rb | 66 +++++++++++-------- .../lib/zeitwerk/loader/callbacks.rb | 12 ++-- .../lib/zeitwerk/loader/config.rb | 16 ++++- .../lib/zeitwerk/loader/eager_load.rb | 2 +- .../lib/zeitwerk/loader/helpers.rb | 6 ++ .../lib/zeitwerk/real_mod_name.rb | 0 .../lib/zeitwerk/registry.rb | 0 .../lib/zeitwerk/version.rb | 2 +- 17 files changed, 72 insertions(+), 41 deletions(-) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/error.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/explicit_namespace.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/gem_inflector.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/gem_loader.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/inflector.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/internal.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/kernel.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/loader.rb (90%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/loader/callbacks.rb (87%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/loader/config.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/loader/eager_load.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/loader/helpers.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/real_mod_name.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/registry.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{zeitwerk-2.6.6 => zeitwerk-2.6.7}/lib/zeitwerk/version.rb (71%) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 3cf027f318..38476fd85d 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -27,7 +27,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.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/tzinfo-2.0.6/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/zeitwerk-2.6.6/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/zeitwerk-2.6.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/activesupport-6.1.7.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-5.0.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.1/lib") diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/error.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/error.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/error.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/error.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/explicit_namespace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/explicit_namespace.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/explicit_namespace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/explicit_namespace.rb index 88b80c2682..e25cb3f897 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/explicit_namespace.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/explicit_namespace.rb @@ -47,6 +47,13 @@ module Zeitwerk disable_tracer_if_unneeded end + # This is an internal method only used by the test suite. + # + # @sig (String) -> bool + internal def registered?(cpath) + cpaths.key?(cpath) + end + # @sig () -> void private def disable_tracer_if_unneeded mutex.synchronize do diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/gem_inflector.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/gem_inflector.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/gem_inflector.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/gem_inflector.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/gem_loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/gem_loader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/gem_loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/gem_loader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/inflector.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/inflector.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/inflector.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/inflector.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/internal.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/internal.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/internal.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/internal.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader.rb index 2973f0b201..7434bcc295 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader.rb @@ -9,6 +9,8 @@ module Zeitwerk require_relative "loader/config" require_relative "loader/eager_load" + extend Internal + include RealModName include Callbacks include Helpers @@ -26,9 +28,9 @@ module Zeitwerk # "/Users/fxn/blog/app/models/hotel/pricing.rb" => [Hotel, :Pricing] # ... # - # @private # @sig Hash[String, [Module, Symbol]] attr_reader :autoloads + internal :autoloads # We keep track of autoloaded directories to remove them from the registry # at the end of eager loading. @@ -36,9 +38,9 @@ module Zeitwerk # Files are removed as they are autoloaded, but directories need to wait due # to concurrency (see why in Zeitwerk::Loader::Callbacks#on_dir_autoloaded). # - # @private # @sig Array[String] attr_reader :autoloaded_dirs + internal :autoloaded_dirs # Stores metadata needed for unloading. Its entries look like this: # @@ -52,9 +54,9 @@ module Zeitwerk # If reloading is enabled, this hash is filled as constants are autoloaded # or eager loaded. Otherwise, the collection remains empty. # - # @private # @sig Hash[String, [String, [Module, Symbol]]] attr_reader :to_unload + internal :to_unload # Maps namespace constant paths to their respective directories. # @@ -70,9 +72,9 @@ module Zeitwerk # and that its children are spread over those directories. We'll visit them # to set up the corresponding autoloads. # - # @private # @sig Hash[String, Array[String]] attr_reader :namespace_dirs + internal :namespace_dirs # A shadowed file is a file managed by this loader that is ignored when # setting autoloads because its matching constant is already taken. @@ -81,17 +83,17 @@ module Zeitwerk # has only scanned the top-level, `shadowed_files` does not have shadowed # files that may exist deep in the project tree yet. # - # @private # @sig Set[String] attr_reader :shadowed_files + internal :shadowed_files - # @private # @sig Mutex attr_reader :mutex + private :mutex - # @private # @sig Mutex attr_reader :mutex2 + private :mutex2 def initialize super @@ -134,7 +136,7 @@ module Zeitwerk # unload them. # # This method is public but undocumented. Main interface is `reload`, which - # means `unload` + `setup`. This one is avaiable to be used together with + # means `unload` + `setup`. This one is available to be used together with # `unregister`, which is undocumented too. # # @sig () -> void @@ -254,9 +256,8 @@ module Zeitwerk # The return value of this predicate is only meaningful if the loader has # scanned the file. This is the case in the spots where we use it. # - # @private # @sig (String) -> Boolean - def shadowed_file?(file) + internal def shadowed_file?(file) shadowed_files.member?(file) end @@ -323,10 +324,8 @@ module Zeitwerk end end - private # ------------------------------------------------------------------------------------- - # @sig (String, Module) -> void - def set_autoloads_in_dir(dir, parent) + private def set_autoloads_in_dir(dir, parent) ls(dir) do |basename, abspath| begin if ruby?(basename) @@ -361,13 +360,22 @@ module Zeitwerk end # @sig (Module, Symbol, String) -> void - def autoload_subdir(parent, cname, subdir) + private def autoload_subdir(parent, cname, subdir) if autoload_path = autoload_path_set_by_me_for?(parent, cname) cpath = cpath(parent, cname) - register_explicit_namespace(cpath) if ruby?(autoload_path) - # We do not need to issue another autoload, the existing one is enough - # no matter if it is for a file or a directory. Just remember the - # subdirectory has to be visited if the namespace is used. + if ruby?(autoload_path) + # Scanning visited a Ruby file first, and now a directory for the same + # constant has been found. This means we are dealing with an explicit + # namespace whose definition was seen first. + # + # Registering is idempotent, and we have to keep the autoload pointing + # to the file. This may run again if more directories are found later + # on, no big deal. + register_explicit_namespace(cpath) + end + # If the existing autoload points to a file, it has to be preserved, if + # not, it is fine as it is. In either case, we do not need to override. + # Just remember the subdirectory conforms this namespace. namespace_dirs[cpath] << subdir elsif !cdef?(parent, cname) # First time we find this namespace, set an autoload for it. @@ -382,7 +390,7 @@ module Zeitwerk end # @sig (Module, Symbol, String) -> void - def autoload_file(parent, cname, file) + private def autoload_file(parent, cname, file) if autoload_path = strict_autoload_path(parent, cname) || Registry.inception?(cpath(parent, cname)) # First autoload for a Ruby file wins, just ignore subsequent ones. if ruby?(autoload_path) @@ -408,7 +416,7 @@ module Zeitwerk # the file where we've found the namespace is explicitly defined. # # @sig (dir: String, file: String, parent: Module, cname: Symbol) -> void - def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:) + private def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:) autoloads.delete(dir) Registry.unregister_autoload(dir) @@ -419,7 +427,7 @@ module Zeitwerk end # @sig (Module, Symbol, String) -> void - def set_autoload(parent, cname, abspath) + private def set_autoload(parent, cname, abspath) parent.autoload(cname, abspath) if logger @@ -440,7 +448,7 @@ module Zeitwerk end # @sig (Module, Symbol) -> String? - def autoload_path_set_by_me_for?(parent, cname) + private def autoload_path_set_by_me_for?(parent, cname) if autoload_path = strict_autoload_path(parent, cname) autoload_path if autoloads.key?(autoload_path) else @@ -449,12 +457,12 @@ module Zeitwerk end # @sig (String) -> void - def register_explicit_namespace(cpath) + private def register_explicit_namespace(cpath) ExplicitNamespace.__register(cpath, self) end # @sig (String) -> void - def raise_if_conflicting_directory(dir) + private def raise_if_conflicting_directory(dir) MUTEX.synchronize do dir_slash = dir + "/" @@ -479,23 +487,23 @@ module Zeitwerk end # @sig (String, Object, String) -> void - def run_on_unload_callbacks(cpath, value, abspath) + private def run_on_unload_callbacks(cpath, value, abspath) # Order matters. If present, run the most specific one. on_unload_callbacks[cpath]&.each { |c| c.call(value, abspath) } on_unload_callbacks[:ANY]&.each { |c| c.call(cpath, value, abspath) } end # @sig (Module, Symbol) -> void - def unload_autoload(parent, cname) - parent.__send__(:remove_const, cname) + private def unload_autoload(parent, cname) + crem(parent, cname) log("autoload for #{cpath(parent, cname)} removed") if logger end # @sig (Module, Symbol) -> void - def unload_cref(parent, cname) + private def unload_cref(parent, cname) # Let's optimistically remove_const. The way we use it, this is going to # succeed always if all is good. - parent.__send__(:remove_const, cname) + crem(parent, cname) rescue ::NameError # There are a few edge scenarios in which this may happen. If the constant # is gone, that is OK, anyway. diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/callbacks.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/callbacks.rb index d8ac2eb706..115eb72f5a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/callbacks.rb @@ -11,18 +11,18 @@ module Zeitwerk::Loader::Callbacks cref = autoloads.delete(file) cpath = cpath(*cref) - # If reloading is enabled, we need to put this constant for unloading - # regardless of what cdef? says. In Ruby < 3.1 the internal state is not - # fully cleared. Module#constants still includes it, and you need to - # remove_const. See https://github.com/ruby/ruby/pull/4715. - to_unload[cpath] = [file, cref] if reloading_enabled? Zeitwerk::Registry.unregister_autoload(file) if cdef?(*cref) log("constant #{cpath} loaded from file #{file}") if logger + to_unload[cpath] = [file, cref] if reloading_enabled? run_on_load_callbacks(cpath, cget(*cref), file) unless on_load_callbacks.empty? else - raise Zeitwerk::NameError.new("expected file #{file} to define constant #{cpath}, but didn't", cref.last) + msg = "expected file #{file} to define constant #{cpath}, but didn't" + log(msg) if logger + crem(*cref) + to_unload[cpath] = [file, cref] if reloading_enabled? + raise Zeitwerk::NameError.new(msg, cref.last) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/config.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/config.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/config.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/config.rb index 7dd514ac7f..b127fa9524 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/config.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/config.rb @@ -149,14 +149,24 @@ module Zeitwerk::Loader::Config # instead. Keys are the absolute paths of the root directories as strings, # values are their corresponding namespaces, class or module objects. # + # If `ignored` is falsey (default), ignored root directories are filtered out. + # # These are read-only collections, please add to them with `push_dir`. # # @sig () -> Array[String] | Hash[String, Module] - def dirs(namespaces: false) + def dirs(namespaces: false, ignored: false) if namespaces - roots.clone + if ignored || ignored_paths.empty? + roots.clone + else + roots.reject { |root_dir, _namespace| ignored_path?(root_dir) } + end else - roots.keys + if ignored || ignored_paths.empty? + roots.keys + else + roots.keys.reject { |root_dir| ignored_path?(root_dir) } + end end.freeze end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb index f4c46afd8e..18809984ff 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb @@ -183,7 +183,7 @@ module Zeitwerk::Loader::EagerLoad end # In order to invoke this method, the caller has to ensure `child` is a - # strict namespace descendendant of `root_namespace`. + # strict namespace descendant of `root_namespace`. # # @sig (Module, String, Module, Boolean) -> void private def eager_load_child_namespace(child, child_name, root_dir, root_namespace) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb index 175ab3534f..566eb8212a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb @@ -134,4 +134,10 @@ module Zeitwerk::Loader::Helpers private def cget(parent, cname) parent.const_get(cname, false) end + + # @raise [NameError] + # @sig (Module, Symbol) -> Object + private def crem(parent, cname) + parent.__send__(:remove_const, cname) + end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/real_mod_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/real_mod_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/real_mod_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/real_mod_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/registry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/registry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/registry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/registry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/version.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/version.rb index ba69ded17f..09a52539eb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.6/lib/zeitwerk/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib/zeitwerk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Zeitwerk - VERSION = "2.6.6" + VERSION = "2.6.7" end From 0ba91becc0e0ee579b1e4bb5d743ce282d878a1b Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Fri, 10 Feb 2023 19:08:36 +0000 Subject: [PATCH 3/3] Update RBI files for zeitwerk. Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. --- ...{zeitwerk@2.6.6.rbi => zeitwerk@2.6.7.rbi} | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{zeitwerk@2.6.6.rbi => zeitwerk@2.6.7.rbi} (94%) diff --git a/Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.6.rbi b/Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.7.rbi similarity index 94% rename from Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.6.rbi rename to Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.7.rbi index 9ca1fde8cf..f5ee1af4b1 100644 --- a/Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.6.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.7.rbi @@ -29,6 +29,7 @@ module Zeitwerk::ExplicitNamespace class << self def __register(cpath, loader); end + def __registered?(cpath); end def __unregister_loader(loader); end private @@ -37,6 +38,7 @@ module Zeitwerk::ExplicitNamespace def disable_tracer_if_unneeded; end def mutex; end def register(cpath, loader); end + def registered?(cpath); end def tracepoint_class_callback(event); end def tracer; end def unregister_loader(loader); end @@ -82,19 +84,18 @@ class Zeitwerk::Loader include ::Zeitwerk::Loader::Helpers include ::Zeitwerk::Loader::Config include ::Zeitwerk::Loader::EagerLoad + extend ::Zeitwerk::Internal def initialize; end - def autoloaded_dirs; end - def autoloads; end - def mutex; end - def mutex2; end - def namespace_dirs; end + def __autoloaded_dirs; end + def __autoloads; end + def __namespace_dirs; end + def __shadowed_file?(file); end + def __shadowed_files; end + def __to_unload; end def reload; end def setup; end - def shadowed_file?(file); end - def shadowed_files; end - def to_unload; end def unload; end def unloadable_cpath?(cpath); end def unloadable_cpaths; end @@ -105,12 +106,20 @@ class Zeitwerk::Loader def autoload_file(parent, cname, file); end def autoload_path_set_by_me_for?(parent, cname); end def autoload_subdir(parent, cname, subdir); end + def autoloaded_dirs; end + def autoloads; end + def mutex; end + def mutex2; end + def namespace_dirs; end def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:); end def raise_if_conflicting_directory(dir); end def register_explicit_namespace(cpath); end def run_on_unload_callbacks(cpath, value, abspath); end def set_autoload(parent, cname, abspath); end def set_autoloads_in_dir(dir, parent); end + def shadowed_file?(file); end + def shadowed_files; end + def to_unload; end def unload_autoload(parent, cname); end def unload_cref(parent, cname); end @@ -145,7 +154,7 @@ module Zeitwerk::Loader::Config def __ignores?(abspath); end def __roots; end def collapse(*glob_patterns); end - def dirs(namespaces: T.unsafe(nil)); end + def dirs(namespaces: T.unsafe(nil), ignored: T.unsafe(nil)); end def do_not_eager_load(*paths); end def enable_reloading; end def ignore(*glob_patterns); end @@ -203,6 +212,7 @@ module Zeitwerk::Loader::Helpers def cdef?(parent, cname); end def cget(parent, cname); end def cpath(parent, cname); end + def crem(parent, cname); end def dir?(path); end def has_at_least_one_ruby_file?(dir); end def hidden?(basename); end