2024-02-06 16:05:38 by Takahiro Kambe | Files touched by this commit (3) | |
Log message: devel/ruby-zeitwerk: update to 2.6.13 2.6.13 (2024-02-06) * There is a new experimental null inflector that simply returns its input unchanged: loader.inflector = Zeitwerk::NullInflector.new Projects using this inflector are expected to define their constants in files and directories with names exactly matching them: User.rb -> User HTMLParser.rb -> HTMLParser Admin/Role.rb -> Admin::Role Please see its documentation for further details. * Documentation improvements. |
2023-11-11 13:34:05 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.6.12 2.6.12 (2023-09-25) * Maintenance release with some internal polishing. |
2023-08-05 10:57:31 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.6.11 2.6.10 (2023-07-30) * Improve validation of the values returned by the inflector's camelize. 2.6.11 (2023-08-02) * Let on_load callbacks for implicit namespaces autoload other implicit namespaces. |
2023-07-30 06:09:01 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.6.9 2.6.9 (2023-07-25) * Given a path as a string or Pathname object, Zeitwerk::Loader#cpath_expected_at returns a string with the corresponding expected constant path. Some examples, assuming that app/models is a root directory: loader.cpath_expected_at("app/models") # => \ "Object" loader.cpath_expected_at("app/models/user.rb") # => \ "User" loader.cpath_expected_at("app/models/hotel") # => \ "Hotel" loader.cpath_expected_at("app/models/hotel/billing.rb") # => \ "Hotel::Billing" This method returns nil for some input like ignored files, and may raise errors too. Please check its documentation for further details. * Zeitwerk::Loader#load_file raises with a more informative error if given a hidden file or directory. * Zeitwerk::Loader#eager_load_dir does nothing if the argument is a hidden file or directory. This is coherent with its existing behavior for eager load exclusions and ignored paths. Before, that kind of argument would result in a non-deliberate NameError. * Documentation improvements. |
2023-04-29 15:41:52 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.6.8 2.6.8 (2023-04-28) * The new Zeitwerk::Loader.for_gem_extension gives you a loader configured according to the conventions of a gem extension. * Please check its documentation for further details. |
2023-02-11 14:48:12 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.6.7 2.6.7 (2023-02-10) * Reset module state on Zeitwerk::NameError. If an autoload is triggered, the file is loaded successfully, but the expected constant does not get defined, Ruby resets the state of the module. In particular, autoload? returns nil for that constant name, and constants does not include the constant name (starting with Ruby 3.1). Zeitwerk is more strict, not defining the expected constant is an error condition and the loader raises Zeitwerk::NameError. But this happens during the require call and the exception prevents Ruby from doing that cleanup. With this change, the parent module is left in a state that makes more sense and is consistent with what Ruby does. * A message is logged if an autoload did not define the expected constant. When that happens, Zeitwerk::NameError is raised and you normally see the exception. But if the error is shallowed, and you are inspecting the logs to investigate something, this new message may be helpful. * By default, Zeitwerk::Loader#dirs filters ignored root directories out. Please, pass ignored: true if you want them included. It is very strange to configure a root directory and also ignore it, the edge case is supported only for completeness. However, in that case, client code listing root directories rarely needs the ignored ones. * Documentation improvements. * Enforcement of private interfaces continues with another gradual patch. |
2022-11-30 15:31:42 by Takahiro Kambe | Files touched by this commit (3) | |
Log message: devel/ruby-zeitwerk: update to 2.6.6 2.6.2 (2022-10-31) * Zeitwerk::Loader#load_file allows you to load an individual Ruby file. Check its documentation for details. * Zeitwerk::Loader#eager_load_dir allows you to eager load a directory, recursively. Check its documentation for details. * Zeitwerk::Loader#eager_load_namespace allows you to eager a namespace, recursively. Namespaces are global, this method loads only what the receiver manages from that namespace, if anything. Check its documentation for details. * Zeitwerk::Loader.eager_load_namespace broadcasts eager_load_namespace to all registered loaders. Check its documentation for details. * Documents shadowed files. They always existed, but were not covered by the documentation. * Other assorted documentation improvements. 2.6.3 (2022-10-31) * v2.6.2 introduced a regression in the logic that checks whether two loaders want to manage the same root directories. It has been fixed. 2.6.4 (2022-11-01) Ruby does not have gem-level visibility, so sometimes you need things to be public for them to be accessible internally. But they do not belong to the public interface of the gem. A method that is undocumented and marked as @private in the source code is clearly private API, regardless of its formal Ruby visibility. This release starts a series of gradual patches in which private interface is enforced with stricter formal visibility. 2.6.5 (2022-11-06) * Controlled errors in a couple of situations: o Attempting to eager load or reload without previously invoking setup now raises Zeitwerk::SetupRequired. o The method Zeitwerk::Loader#push_dir raises Zeitwerk::Error if it gets an anonymous custom namespace. * These should be backwards compatible, because they raise in circumstances that didn't work anyway. The goal here is to provide a meaningful error upfront. * Enforcement of private interfaces continues with another gradual patch. 2.6.6 (2022-11-08) * The new eager_load_namespace had a bug when eager loading certain namespaces with collapsed directories. This has been fixed. |
2022-10-09 09:37:47 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.6.1 2.6.1 (2022-10-01) * Zeitwerk::Loader#dirs allows you to instrospect the root directories configured in the receiver. Please check its documentation for details. |
2022-08-26 16:55:20 by Takahiro Kambe | Files touched by this commit (3) | |
Log message: devel/ruby-zeitwerk: update to 2.6.0 2.6.0 (13 June 2022) * Directories are processed in lexicographic order. Different file systems may list directories in different order, and with this change we ensure that client code eager loads consistently across platforms, for example. * Before this release, subdirectories of root directories always represented namespaces (unless ignored or collapsed). From now on, to be considered namespaces they also have to contain at least one non-ignored Ruby file with extension .rb, directly or recursively. If you know beforehand a certain directory or directory pattern does not represent a namespace, it is intentional and more efficient to tell Zeitwerk to ignore it. However, if you don't do so and have a directory tasks that only contains Rake files, arguably that directory is not meant to represent a Ruby module. Before, Zeitwerk would define a top-level Tasks module after it; now, it does not. This feature is also handy for projects that have directories with auxiliary resources mixed in the project tree in a way that is too dynamic for an ignore pattern to be practical. See #216. In the unlikely case that an existing project has an empty directory for the sole purpose of defining a totally empty module (no code, and no nested classes or modules), such module has now to be defined in a file. Directories are scanned again on reloads. * On setup, loaders created with Zeitwerk::Loader.for_gem issue warnings if lib has extra, non-ignored Ruby files or directories. This is motivated by existing gems with directories under lib that are not meant to define Ruby modules, like directories for Rails generators, for instance. This warning can be silenced in the unlikely case that the extra stuff is actually autoloadable and has to be managed by Zeitwerk. Please, check the documentation for further details. This method returns an instance of a private subclass of Zeitwerk::Loader now, but you cannot rely on the type, just on the interface. |
2022-02-12 16:22:38 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-zeitwerk: update to 2.5.4 2.5.4 (2022-01-28) * If a file did not define the expected constant, there was a reload, and there were on_unload callbacks, Zeitwerk still tried to access the constant during reload, which raised. This has been corrected. |