Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2022-10-12 18:25:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-zeitwerk"

Wed Oct 12 18:25:08 2022 rev:14 rq:1010057 version:2.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes        
2022-06-17 21:23:38.490810093 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.2275/rubygem-zeitwerk.changes  
    2022-10-12 18:26:55.837985598 +0200
@@ -1,0 +2,6 @@
+Mon Oct 10 13:27:38 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 2.6.1
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  zeitwerk-2.6.0.gem

New:
----
  zeitwerk-2.6.1.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-zeitwerk.spec ++++++
--- /var/tmp/diff_new_pack.7lwZbE/_old  2022-10-12 18:26:56.253986514 +0200
+++ /var/tmp/diff_new_pack.7lwZbE/_new  2022-10-12 18:26:56.257986523 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-zeitwerk
-Version:        2.6.0
+Version:        2.6.1
 Release:        0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}

++++++ zeitwerk-2.6.0.gem -> zeitwerk-2.6.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2022-06-13 18:42:15.000000000 +0200
+++ new/README.md       2022-10-01 00:18:05.000000000 +0200
@@ -47,6 +47,7 @@
   - [Edge cases](#edge-cases)
   - [Beware of circular dependencies](#beware-of-circular-dependencies)
   - [Reopening third-party namespaces](#reopening-third-party-namespaces)
+  - [Introspection](#introspection)
   - [Encodings](#encodings)
   - [Rules of thumb](#rules-of-thumb)
   - [Debuggers](#debuggers)
@@ -249,7 +250,7 @@
 
 and does not have a file called `admin.rb`, Zeitwerk automatically creates an 
`Admin` module on your behalf the first time `Admin` is used.
 
-For this to happen, the directory has to contain non-ignored Ruby files, 
directly or recursively, otherwise it is ignored. This condition is evaluated 
again on reloads.
+For this to happen, the directory has to contain non-ignored Ruby files with 
extension `.rb`, directly or recursively, otherwise it is ignored. This 
condition is evaluated again on reloads.
 
 <a id="markdown-explicit-namespaces" name="explicit-namespaces"></a>
 ### Explicit namespaces
@@ -983,12 +984,36 @@
 require "active_job/queue_adapters"
 
 require "zeitwerk"
-loader = Zeitwerk::Loader.for_gem
+# By passign the flag, we acknowledge the extra directory lib/active_job
+# has to be managed by the loader and no warning has to be issued for it.
+loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
 loader.setup
 ```
 
 With that, when Zeitwerk scans the file system and reaches the gem directories 
`lib/active_job` and `lib/active_job/queue_adapters`, it detects the 
corresponding modules already exist and therefore understands it does not have 
to manage them. The loader just descends into those directories. Eventually 
will reach `lib/active_job/queue_adapters/awesome_queue.rb`, and since 
`ActiveJob::QueueAdapters::AwesomeQueue` is unknown, Zeitwerk will manage it. 
Which is what happens regularly with the files in your gem. On reload, the 
namespaces are safe, won't be reloaded. The loader only reloads what it 
manages, which in this case is the adapter itself.
 
+<a id="markdown-introspection" name="introspection"></a>
+### Introspection
+
+The method `Zeitwerk::Loader#dirs` returns an array with the absolute paths of 
the root directories as strings:
+
+```ruby
+loader = Zeitwerk::Loader.new
+loader.push_dir(Pathname.new("/foo"))
+loader.dirs # => ["/foo"]
+```
+
+This method accepts an optional `namespaces` keyword argument. If truthy, the 
method returns a hash table instead. Keys are the absolute paths of the root 
directories as strings. Values are their corresponding namespaces, class or 
module objects:
+
+```ruby
+loader = Zeitwerk::Loader.new
+loader.push_dir(Pathname.new("/foo"))
+loader.push_dir(Pathname.new("/bar"), namespace: Bar)
+loader.dirs(namespaces: true) # => { "/foo" => Object, "/bar" => Bar }
+```
+
+These collections are read-only. Please add to them with 
`Zeitwerk::Loader#push_dir`.
+
 <a id="markdown-encodings" name="encodings"></a>
 ### Encodings
 
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/zeitwerk/loader/config.rb 
new/lib/zeitwerk/loader/config.rb
--- old/lib/zeitwerk/loader/config.rb   2022-06-13 18:42:15.000000000 +0200
+++ new/lib/zeitwerk/loader/config.rb   2022-10-01 00:18:05.000000000 +0200
@@ -5,18 +5,19 @@
 
 module Zeitwerk::Loader::Config
   # Absolute paths of the root directories. Stored in a hash to preserve
-  # order, easily handle duplicates, and also be able to have a fast lookup,
-  # needed for detecting nested paths.
+  # order, easily handle duplicates, have a fast lookup needed for detecting
+  # nested paths, and store custom namespaces as values.
   #
-  #   "/Users/fxn/blog/app/assets"   => true,
-  #   "/Users/fxn/blog/app/channels" => true,
+  #   "/Users/fxn/blog/app/assets"   => Object,
+  #   "/Users/fxn/blog/app/channels" => Object,
+  #   "/Users/fxn/blog/adapters"     => ActiveJob::QueueAdapters,
   #   ...
   #
   # This is a private collection maintained by the loader. The public
   # interface for it is `push_dir` and `dirs`.
   #
   # @private
-  # @sig Hash[String, true]
+  # @sig Hash[String, Module]
   attr_reader :root_dirs
 
   # @sig #camelize
@@ -136,12 +137,20 @@
     @tag = tag.to_s
   end
 
-  # Absolute paths of the root directories. This is a read-only collection,
-  # please push here via `push_dir`.
-  #
-  # @sig () -> Array[String]
-  def dirs
-    root_dirs.keys.freeze
+  # If `namespaces` is falsey (default), returns an array with the absolute
+  # paths of the root directories as strings. If truthy, returns a hash table
+  # instead. Keys are the absolute paths of the root directories as strings,
+  # values are their corresponding namespaces, class or module objects.
+  #
+  # These are read-only collections, please add to them with `push_dir`.
+  #
+  # @sig () -> Array[String] | Hash[String, Module]
+  def dirs(namespaces: false)
+    if namespaces
+      root_dirs.clone
+    else
+      root_dirs.keys
+    end.freeze
   end
 
   # You need to call this method before setup in order to be able to reload.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/zeitwerk/version.rb new/lib/zeitwerk/version.rb
--- old/lib/zeitwerk/version.rb 2022-06-13 18:42:15.000000000 +0200
+++ new/lib/zeitwerk/version.rb 2022-10-01 00:18:05.000000000 +0200
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module Zeitwerk
-  VERSION = "2.6.0"
+  VERSION = "2.6.1"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-06-13 18:42:15.000000000 +0200
+++ new/metadata        2022-10-01 00:18:05.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: zeitwerk
 version: !ruby/object:Gem::Version
-  version: 2.6.0
+  version: 2.6.1
 platform: ruby
 authors:
 - Xavier Noria
 autorequire:
 bindir: bin
 cert_chain: []
-date: 2022-06-13 00:00:00.000000000 Z
+date: 2022-09-30 00:00:00.000000000 Z
 dependencies: []
 description: |2
       Zeitwerk implements constant autoloading with Ruby semantics. Each gem

Reply via email to