commit rubygem-zeitwerk for openSUSE:Factory

2020-11-02 Thread root
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2020-11-02 10:36:07

Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and  /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.3463 (New)


Package is "rubygem-zeitwerk"

Mon Nov  2 10:36:07 2020 rev:7 rq:845263 version:2.4.1

Changes:

--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes
2020-07-16 12:21:42.223161989 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.3463/rubygem-zeitwerk.changes  
2020-11-02 10:36:31.267301969 +0100
@@ -1,0 +2,7 @@
+Sun Nov  1 13:09:57 UTC 2020 - Manuel Schnitzer 
+
+- updated to version 2.4.1
+
+  * Use `__send__` instead of `send` internally.
+
+---

Old:

  zeitwerk-2.4.0.gem

New:

  zeitwerk-2.4.1.gem



Other differences:
--
++ rubygem-zeitwerk.spec ++
--- /var/tmp/diff_new_pack.WHLwOU/_old  2020-11-02 10:36:33.099303225 +0100
+++ /var/tmp/diff_new_pack.WHLwOU/_new  2020-11-02 10:36:33.103303228 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:   rubygem-zeitwerk
-Version:2.4.0
+Version:2.4.1
 Release:0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}

++ zeitwerk-2.4.0.gem -> zeitwerk-2.4.1.gem ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md   2020-07-15 00:11:04.0 +0200
+++ new/README.md   2020-10-29 11:34:25.0 +0100
@@ -151,7 +151,7 @@
 loader.push_dir("#{__dir__}/adapters", namespace: ActiveJob::QueueAdapters)
 ```
 
-your adapter can be stored directly in that directory instead of the canonical 
`lib/active_job/queue_adapters`.
+your adapter can be stored directly in that directory instead of the canonical 
`#{__dir__}/active_job/queue_adapters`.
 
 Please, note that the given namespace must be non-reloadable, though 
autoloaded constants in that namespace can be. That is, if you associate 
`app/api` with an existing `Api` module, that module should not be reloadable. 
However, if the project defines and autoloads the class `Api::V2::Deliveries`, 
that one can be reloaded.
 
@@ -202,7 +202,7 @@
 To make it work that way, configure Zeitwerk to collapse said directory:
 
 ```ruby
-loader.collapse("booking/actions")
+loader.collapse("#{__dir__}/booking/actions")
 ```
 
 This method accepts an arbitrary number of strings or `Pathname` objects, and 
also an array of them.
@@ -212,7 +212,7 @@
 To illustrate usage of glob patterns, if `actions` in the example above is 
part of a standardized structure, you could use a wildcard:
 
 ```ruby
-loader.collapse("*/actions")
+loader.collapse("#{__dir__}/*/actions")
 ```
 
 
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/explicit_namespace.rb 
new/lib/zeitwerk/explicit_namespace.rb
--- old/lib/zeitwerk/explicit_namespace.rb  2020-07-15 00:11:04.0 
+0200
+++ new/lib/zeitwerk/explicit_namespace.rb  2020-10-29 11:34:25.0 
+0100
@@ -14,24 +14,22 @@
   # the file system, to the loader responsible for them.
   #
   # @private
-  # @return [{String => Zeitwerk::Loader}]
+  # @sig Hash[String, Zeitwerk::Loader]
   attr_reader :cpaths
 
   # @private
-  # @return [Mutex]
+  # @sig Mutex
   attr_reader :mutex
 
   # @private
-  # @return [TracePoint]
+  # @sig TracePoint
   attr_reader :tracer
 
   # Asserts `cpath` corresponds to an explicit namespace for which `loader`
   # is responsible.
   #
   # @private
-  # @param cpath [String]
-  # @param loader [Zeitwerk::Loader]
-  # @return [void]
+  # @sig (String, Zeitwerk::Loader) -> void
   def register(cpath, loader)
 mutex.synchronize do
   cpaths[cpath] = loader
@@ -42,19 +40,22 @@
   end
 
   # @private
-  # @param loader [Zeitwerk::Loader]
-  # @return [void]
+  # @sig (Zeitwerk::Loader) -> void
   def unregister(loader)
 cpaths.delete_if { |_cpath, l| l == loader }
 disable_tracer_if_unneeded
   end
 
+  private
+
+  # @sig () -> void
   def disable_tracer_if_unneeded
 mutex.synchronize do
   tracer.disable if cpaths.empty?
 end
   end
 
+  # @sig (TracePoint) -> void
   def tracepoint_class_callback(event)
 # If the class is a singleton class, we won't do anything with it so we
 # can bail out immediately. This is several orders of magnitude faster
diff -urN '--exclude=CVS' 

commit rubygem-zeitwerk for openSUSE:Factory

2020-07-16 Thread root
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2020-07-16 12:19:26

Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and  /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.3592 (New)


Package is "rubygem-zeitwerk"

Thu Jul 16 12:19:26 2020 rev:6 rq:821253 version:2.4.0

Changes:

--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes
2020-07-14 08:01:47.842276832 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.3592/rubygem-zeitwerk.changes  
2020-07-16 12:21:42.223161989 +0200
@@ -1,0 +2,9 @@
+Thu Jul 16 08:43:36 UTC 2020 - Manuel Schnitzer 
+
+- updated to version 2.4.0
+
+  * `Zeitwerk::Loader#push_dir` supports an optional `namespace` keyword 
argument. Pass a class or module object if you want the given root directory to 
be associated with it instead of `Object`. Said class or module object cannot 
be reloadable.
+
+  * The default inflector is even more performant.
+
+---

Old:

  zeitwerk-2.3.1.gem

New:

  zeitwerk-2.4.0.gem



Other differences:
--
++ rubygem-zeitwerk.spec ++
--- /var/tmp/diff_new_pack.gQuVPJ/_old  2020-07-16 12:21:44.195163983 +0200
+++ /var/tmp/diff_new_pack.gQuVPJ/_new  2020-07-16 12:21:44.195163983 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:   rubygem-zeitwerk
-Version:2.3.1
+Version:2.4.0
 Release:0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}

++ zeitwerk-2.3.1.gem -> zeitwerk-2.4.0.gem ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md   2020-06-29 01:10:59.0 +0200
+++ new/README.md   2020-07-15 00:11:04.0 +0200
@@ -139,6 +139,22 @@
 app/controllers/admin/users_controller.rb -> Admin::UsersController
 ```
 
+Alternatively, you can associate a custom namespace to a root directory by 
passing a class or module object in the optional `namespace` keyword argument.
+
+For example, Active Job queue adapters have to define a constant after their 
name in `ActiveJob::QueueAdapters`.
+
+So, if you declare
+
+```ruby
+require "active_job"
+require "active_job/queue_adapters"
+loader.push_dir("#{__dir__}/adapters", namespace: ActiveJob::QueueAdapters)
+```
+
+your adapter can be stored directly in that directory instead of the canonical 
`lib/active_job/queue_adapters`.
+
+Please, note that the given namespace must be non-reloadable, though 
autoloaded constants in that namespace can be. That is, if you associate 
`app/api` with an existing `Api` module, that module should not be reloadable. 
However, if the project defines and autoloads the class `Api::V2::Deliveries`, 
that one can be reloaded.
+
 
 ### Implicit namespaces
 
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/inflector.rb 
new/lib/zeitwerk/inflector.rb
--- old/lib/zeitwerk/inflector.rb   2020-06-29 01:10:59.0 +0200
+++ new/lib/zeitwerk/inflector.rb   2020-07-15 00:11:04.0 +0200
@@ -15,7 +15,7 @@
 # @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:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/zeitwerk/loader.rb new/lib/zeitwerk/loader.rb
--- old/lib/zeitwerk/loader.rb  2020-06-29 01:10:59.0 +0200
+++ new/lib/zeitwerk/loader.rb  2020-07-15 00:11:04.0 +0200
@@ -190,13 +190,19 @@
 # or descendants.
 #
 # @param path []
+# @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 @@
   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|
+  

commit rubygem-zeitwerk for openSUSE:Factory

2020-07-14 Thread root
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2020-07-14 08:00:55

Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and  /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.3060 (New)


Package is "rubygem-zeitwerk"

Tue Jul 14 08:00:55 2020 rev:5 rq:820704 version:2.3.1

Changes:

--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes
2020-04-27 23:41:15.383860339 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.3060/rubygem-zeitwerk.changes  
2020-07-14 08:01:47.842276832 +0200
@@ -1,0 +2,11 @@
+Mon Jul 13 14:43:11 UTC 2020 - Manuel Schnitzer 
+
+- updated to version 2.3.1
+
+  * Saves some unnecessary allocations made internally by MRI. See 
[#125](https://github.com/fxn/zeitwerk/pull/125), by 
[@casperisfine](https://github.com/casperisfine).
+
+  * Documentation improvements.
+
+  * Internal code base maintenance.
+
+---

Old:

  zeitwerk-2.3.0.gem

New:

  zeitwerk-2.3.1.gem



Other differences:
--
++ rubygem-zeitwerk.spec ++
--- /var/tmp/diff_new_pack.E5pWKe/_old  2020-07-14 08:01:50.014283865 +0200
+++ /var/tmp/diff_new_pack.E5pWKe/_new  2020-07-14 08:01:50.018283878 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:   rubygem-zeitwerk
-Version:2.3.0
+Version:2.3.1
 Release:0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}
@@ -42,7 +42,7 @@
 %description
 Zeitwerk implements constant autoloading with Ruby semantics. Each gem
 and application may have their own independent autoloader, with its own
-configuration, inflector, and logger. Supports autoloading, preloading,
+configuration, inflector, and logger. Supports autoloading,
 reloading, and eager loading.
 
 %prep

++ zeitwerk-2.3.0.gem -> zeitwerk-2.3.1.gem ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md   2020-03-03 20:52:17.0 +0100
+++ new/README.md   2020-06-29 01:10:59.0 +0200
@@ -16,6 +16,8 @@
 - [Nested root directories](#nested-root-directories)
 - [Usage](#usage)
 - [Setup](#setup)
+- [Generic](#generic)
+- [for_gem](#for_gem)
 - [Autoloading](#autoloading)
 - [Eager loading](#eager-loading)
 - [Reloading](#reloading)
@@ -30,8 +32,11 @@
 - [Use case: The adapter pattern](#use-case-the-adapter-pattern)
 - [Use case: Test files mixed with implementation 
files](#use-case-test-files-mixed-with-implementation-files)
 - [Edge cases](#edge-cases)
+- [Reopening third-party namespaces](#reopening-third-party-namespaces)
 - [Rules of thumb](#rules-of-thumb)
-- [Autoloading, explicit namespaces, and 
debuggers](#autoloading-explicit-namespaces-and-debuggers)
+- [Debuggers](#debuggers)
+- [Break](#break)
+- [Byebug](#byebug)
 - [Pronunciation](#pronunciation)
 - [Supported Ruby versions](#supported-ruby-versions)
 - [Testing](#testing)
@@ -52,7 +57,9 @@
 
 The gem is designed so that any project, gem dependency, application, etc. can 
have their own independent loader, coexisting in the same process, managing 
their own project trees, and independent of each other. Each loader has its own 
configuration, inflector, and optional logger.
 
-Internally, Zeitwerk issues `require` calls exclusively using absolute file 
names, so there are no costly file system lookups in `$LOAD_PATH`. Technically, 
the directories managed by Zeitwerk do not even need to be in `$LOAD_PATH`. 
Furthermore, Zeitwerk does only one single scan of the project tree, and it 
descends into subdirectories lazily, only if their namespaces are used.
+Internally, Zeitwerk issues `require` calls exclusively using absolute file 
names, so there are no costly file system lookups in `$LOAD_PATH`. Technically, 
the directories managed by Zeitwerk do not even need to be in `$LOAD_PATH`.
+
+Furthermore, Zeitwerk does at most one single scan of the project tree, and it 
descends into subdirectories lazily, only if their namespaces are used.
 
 
 ## Synopsis
@@ -211,6 +218,9 @@
 
 ### Setup
 
+
+ Generic
+
 Loaders are ready to load code right after calling `setup` on them:
 
 ```ruby
@@ -227,9 +237,36 @@
 loader.setup
 ```
 
-The loader returned by `Zeitwerk::Loader.for_gem` has the directory of the 
caller pushed, normally that is the absolute path of `lib`. In that sense, 
`for_gem` can be used also by projects with a gem structure, even if they are 
not technically gems. That is, you don't need a gemspec or anything.
+
+ for_gem
+
+`Zeitwerk::Loader.for_gem` is a convenience shortcut for the 

commit rubygem-zeitwerk for openSUSE:Factory

2020-04-27 Thread root
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2020-04-27 23:41:05

Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and  /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.2738 (New)


Package is "rubygem-zeitwerk"

Mon Apr 27 23:41:05 2020 rev:4 rq:798230 version:2.3.0

Changes:

--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes
2019-12-14 12:23:58.519193924 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.2738/rubygem-zeitwerk.changes  
2020-04-27 23:41:15.383860339 +0200
@@ -1,0 +2,25 @@
+Mon Apr 27 11:38:16 UTC 2020 - Manuel Schnitzer 
+
+- updated to version 2.3.0
+
+  * Adds support for collapsing directories.
+
+  For example, if `booking/actions/create.rb` is meant to define 
`Booking::Create`
+  because the subdirectory `actions` is there only for organizational 
purposes,
+  you can tell Zeitwerk with `collapse`:
+
+  ```ruby
+  loader.collapse("booking/actions")
+  ```
+
+  The method also accepts glob patterns to support standardized project 
structures:
+
+  ```ruby
+  loader.collapse("*/actions")
+  ```
+
+  Please check the documentation for more details.
+
+  * Eager loading is idempotent, but now you can eager load again after 
reloading.
+
+---

Old:

  zeitwerk-2.2.2.gem

New:

  zeitwerk-2.3.0.gem



Other differences:
--
++ rubygem-zeitwerk.spec ++
--- /var/tmp/diff_new_pack.0TULDB/_old  2020-04-27 23:41:16.071861682 +0200
+++ /var/tmp/diff_new_pack.0TULDB/_new  2020-04-27 23:41:16.075861689 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-zeitwerk
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 #
 
 Name:   rubygem-zeitwerk
-Version:2.2.2
+Version:2.3.0
 Release:0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}

++ zeitwerk-2.2.2.gem -> zeitwerk-2.3.0.gem ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md   2019-11-29 17:02:42.0 +0100
+++ new/README.md   2020-03-03 20:52:17.0 +0100
@@ -12,6 +12,7 @@
 - [File structure](#file-structure)
 - [Implicit namespaces](#implicit-namespaces)
 - [Explicit namespaces](#explicit-namespaces)
+- [Collapsing directories](#collapsing-directories)
 - [Nested root directories](#nested-root-directories)
 - [Usage](#usage)
 - [Setup](#setup)
@@ -165,6 +166,32 @@
 
 An explicit namespace must be managed by one single loader. Loaders that 
reopen namespaces owned by other projects are responsible for loading their 
constants before setup.
 
+
+### Collapsing directories
+
+Say some directories in a project exist for organizational purposes only, and 
you prefer not to have them as namespaces. For example, the `actions` 
subdirectory in the next example is not meant to represent a namespace, it is 
there only to group all actions related to bookings:
+
+```
+booking.rb-> Booking
+booking/actions/create.rb -> Booking::Create
+```
+
+To make it work that way, configure Zeitwerk to collapse said directory:
+
+```ruby
+loader.collapse("booking/actions")
+```
+
+This method accepts an arbitrary number of strings or `Pathname` objects, and 
also an array of them.
+
+You can pass directories and glob patterns. Glob patterns are expanded when 
they are added, and again on each reload.
+
+To illustrate usage of glob patterns, if `actions` in the example above is 
part of a standardized structure, you could use a wildcard:
+
+```ruby
+loader.collapse("*/actions")
+```
+
 
 ### Nested root directories
 
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.rb new/lib/zeitwerk/loader.rb
--- old/lib/zeitwerk/loader.rb  2019-11-29 17:02:42.0 +0100
+++ new/lib/zeitwerk/loader.rb  2020-03-03 20:52:17.0 +0100
@@ -39,7 +39,7 @@
 # @return []
 attr_reader :preloads
 
-# Absolute paths of files, directories, of glob patterns to be totally
+# Absolute paths of files, directories, or glob patterns to be totally
 # ignored.
 #
 # @private
@@ -54,6 +54,19 @@
 # @return [Set]
 attr_reader :ignored_paths
 
+# Absolute paths of directories or glob patterns to be 

commit rubygem-zeitwerk for openSUSE:Factory

2019-12-14 Thread root
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2019-12-14 12:21:45

Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and  /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.4691 (New)


Package is "rubygem-zeitwerk"

Sat Dec 14 12:21:45 2019 rev:3 rq:756943 version:2.2.2

Changes:

--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes
2019-11-13 13:25:23.899514628 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.4691/rubygem-zeitwerk.changes  
2019-12-14 12:23:58.519193924 +0100
@@ -1,0 +2,7 @@
+Sat Dec 14 00:32:05 UTC 2019 - Manuel Schnitzer 
+
+- updated to version 2.2.2
+
+  * `Zeitwerk::NameError#name` has the name of the missing constant now.
+
+---

Old:

  zeitwerk-2.2.1.gem

New:

  zeitwerk-2.2.2.gem



Other differences:
--
++ rubygem-zeitwerk.spec ++
--- /var/tmp/diff_new_pack.j8tKPW/_old  2019-12-14 12:23:59.011193850 +0100
+++ /var/tmp/diff_new_pack.j8tKPW/_new  2019-12-14 12:23:59.011193850 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:   rubygem-zeitwerk
-Version:2.2.1
+Version:2.2.2
 Release:0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}

++ zeitwerk-2.2.1.gem -> zeitwerk-2.2.2.gem ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md   2019-11-01 12:53:07.0 +0100
+++ new/README.md   2019-11-29 17:02:42.0 +0100
@@ -15,8 +15,9 @@
 - [Nested root directories](#nested-root-directories)
 - [Usage](#usage)
 - [Setup](#setup)
-- [Reloading](#reloading)
+- [Autoloading](#autoloading)
 - [Eager loading](#eager-loading)
+- [Reloading](#reloading)
 - [Inflection](#inflection)
 - [Zeitwerk::Inflector](#zeitwerkinflector)
 - [Zeitwerk::GemInflector](#zeitwerkgeminflector)
@@ -219,33 +220,28 @@
 
 Zeitwerk works internally only with absolute paths to avoid costly file 
searches in `$LOAD_PATH`. Indeed, the root directories do not even need to 
belong to `$LOAD_PATH`, everything just works by design if they don't.
 
-
-### Reloading
+
+### Autoloading
 
-Zeitwerk is able to reload code, but you need to enable this feature:
+After `setup`, you are able to reference classes and modules from the project 
without issuing `require` calls for them. They are all available everywhere, 
autoloading loads them on demand. This works even if the reference to the class 
or module is first hit in client code, outside your project.
 
-```ruby
-loader = Zeitwerk::Loader.new
-loader.push_dir(...)
-loader.enable_reloading # you need to opt-in before setup
-loader.setup
-...
-loader.reload
-```
-
-There is no way to undo this, either you want to reload or you don't.
+Let's revisit the example above:
 
-Enabling reloading after setup raises `Zeitwerk::Error`. Similarly, calling 
`reload` without having enabled reloading also raises `Zeitwerk::Error`.
-
-Generally speaking, reloading is useful while developing running services like 
web applications. Gems that implement regular libraries, so to speak, or 
services running in testing or production environments, won't normally have a 
use case for reloading. If reloading is not enabled, Zeitwerk is able to use 
less memory.
+```ruby
+# lib/my_gem.rb (main file)
 
-Reloading removes the currently loaded classes and modules and resets the 
loader so that it will pick whatever is in the file system now.
+require "zeitwerk"
+loader = Zeitwerk::Loader.for_gem
+loader.setup
 
-It is important to highlight that this is an instance method. Don't worry 
about project dependencies managed by Zeitwerk, their loaders are independent.
+module MyGem
+  include MyLogger # (*)
+end
+```
 
-In order for reloading to be thread-safe, you need to implement some 
coordination. For example, a web framework that serves each request with its 
own thread may have a globally accessible RW lock. When a request comes in, the 
framework acquires the lock for reading at the beginning, and the code in the 
framework that calls `loader.reload` needs to acquire the lock for writing.
+That works, and there is no `require "my_gem/my_logger"`. When `(*)` is 
reached, Zeitwerk seamlessly autoloads `MyGem::MyLogger`.
 
-On reloading, client code has to update anything that would otherwise be 
storing a stale object. For example, if the routing layer of a web framework 
stores controller class objects or instances in internal structures, on reload 
it has to refresh them somehow, possibly reevaluating routes.
+If autoloading a file does not define the expected class or 

commit rubygem-zeitwerk for openSUSE:Factory

2019-11-13 Thread root
Hello community,

here is the log from the commit of package rubygem-zeitwerk for 
openSUSE:Factory checked in at 2019-11-13 13:25:22

Comparing /work/SRC/openSUSE:Factory/rubygem-zeitwerk (Old)
 and  /work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.2990 (New)


Package is "rubygem-zeitwerk"

Wed Nov 13 13:25:22 2019 rev:2 rq:747690 version:2.2.1

Changes:

--- /work/SRC/openSUSE:Factory/rubygem-zeitwerk/rubygem-zeitwerk.changes
2019-08-19 23:02:21.663448257 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-zeitwerk.new.2990/rubygem-zeitwerk.changes  
2019-11-13 13:25:23.899514628 +0100
@@ -1,0 +2,25 @@
+Tue Nov 12 14:02:42 UTC 2019 - Manuel Schnitzer 
+
+- updated to version 2.2.1
+
+  * Zeitwerk raised `NameError` when a managed file did not define its 
expected constant. Now, it raises `Zeitwerk::NameError` instead, so it is 
possible for client code to distinguish that mismatch from a regular 
`NameError`.
+
+  Regarding backwards compatibility, `Zeitwerk::NameError` is a subclass 
of `NameError`.
+
+  ## 2.2.0 (9 October 2019)
+
+  * The default inflectors have API to override how to camelize selected 
basenames:
+
+  ```ruby
+  loader.inflector.inflect "mysql_adapter" => "MySQLAdapter"
+  ```
+
+  This addresses a common pattern, which is to use the basic inflectors 
with a few straightforward exceptions typically configured in a hash table or 
`case` expression. You no longer have to define a custom inflector if that is 
all you need.
+
+  * Documentation improvements.
+
+  ## 2.1.10 (6 September 2019)
+
+  * Raises `Zeitwerk::NameError` with a better error message when a managed 
file or directory has a name that yields an invalid constant name when 
inflected. `Zeitwerk::NameError` is a subclass of `NameError`.
+
+---

Old:

  zeitwerk-2.1.9.gem

New:

  zeitwerk-2.2.1.gem



Other differences:
--
++ rubygem-zeitwerk.spec ++
--- /var/tmp/diff_new_pack.rxIvxr/_old  2019-11-13 13:25:24.559515314 +0100
+++ /var/tmp/diff_new_pack.rxIvxr/_new  2019-11-13 13:25:24.563515318 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:   rubygem-zeitwerk
-Version:2.1.9
+Version:2.2.1
 Release:0
 %define mod_name zeitwerk
 %define mod_full_name %{mod_name}-%{version}
@@ -51,7 +51,7 @@
 
 %install
 %gem_install \
-  --doc-files="README.md" \
+  --doc-files="MIT-LICENSE README.md" \
   -f
 
 %gem_packages

++ zeitwerk-2.1.9.gem -> zeitwerk-2.2.1.gem ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MIT-LICENSE new/MIT-LICENSE
--- old/MIT-LICENSE 1970-01-01 01:00:00.0 +0100
+++ new/MIT-LICENSE 2019-11-01 12:53:07.0 +0100
@@ -0,0 +1,20 @@
+Copyright (c) 2019–ω Xavier Noria
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md   2019-07-16 23:21:48.0 +0200
+++ new/README.md   2019-11-01 12:53:07.0 +0100
@@ -3,7 +3,7 @@
 
 
 [![Gem 
Version](https://img.shields.io/gem/v/zeitwerk.svg?style=for-the-badge)](https://rubygems.org/gems/zeitwerk)
-[![Build 
Status](https://img.shields.io/travis/com/fxn/zeitwerk.svg?style=for-the-badge=master)](https://travis-ci.com/fxn/zeitwerk)
+[![Build 
Status](https://img.shields.io/travis/com/fxn/zeitwerk/master?style=for-the-badge)](https://travis-ci.com/fxn/zeitwerk)
 
 
 
@@ -29,8 +29,10 @@
 - [Use case: Test files mixed with implementation 
files](#use-case-test-files-mixed-with-implementation-files)
 - [Edge cases](#edge-cases)
 - [Rules of thumb](#rules-of-thumb)
+- [Autoloading, explicit