XPBytes / administrate-base_controller

:stars: Extends the ApplicationController in Administrate
MIT License
4 stars 2 forks source link

🚨 [security] Update rails: 6.1.5 → 6.1.7 (patch) #86

Closed depfu[bot] closed 1 year ago

depfu[bot] commented 2 years ago

🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ rails (6.1.5 → 6.1.7) · Repo

Release Notes

6.1.7

Active Support

  • No changes.

Active Model

  • No changes.

Active Record

  • Symbol is allowed by default for YAML columns

    Étienne Barrié

  • Fix ActiveRecord::Store to serialize as a regular Hash

    Previously it would serialize as an ActiveSupport::HashWithIndifferentAccess
    which is wasteful and cause problem with YAML safe_load.

    Jean Boussier

  • Fix PG.connect keyword arguments deprecation warning on ruby 2.7

    Fixes #44307.

    Nikita Vasilevsky

Action View

  • No changes.

Action Pack

  • No changes.

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • Respect Active Record's primary_key_type in Active Storage migrations. Backported from 7.0.

    fatkodima

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

✳️ minitest (5.15.0 → 5.16.3) · Repo · Changelog

Release Notes

5.16.3 (from changelog)

  • 2 bug fixes:

    • Fixed exception sanitization by removing TypeError restriction on rescue.

    • Use A instead of deprecated TESTOPTS in rake test:slow. (davidstosik)

5.16.2 (from changelog)

  • 4 bug fixes:

    • Added MT_KWARGS_HACK kludge for stub to deal with ruby 2.7 kwargs nastiness. (tsugimoto)

    • In #expect, pop Hash class from args if $MT_KWARGS_HACK. (casperisfine)

    • In above scenario, set expected kwargs (as Objects) based on actual kwargs.

    • Nuke ivars if exception fails to marshal twice (eg better_errors). (irphilli)

5.16.1 (from changelog)

  • 2 bug fixes:

    • Apparently adding real kwarg support to mocks/stubs broke some code. Fixed.

      • Use `MT_KWARGS_HACK=1` to activate the kludgy kwargs support w/ caveats.

    • Clarified some doco wrt the block on #stub.

5.16.0 (from changelog)

  • 2 major enhancements:

    • Added Minitest::TestTask.

    • Dropping ruby 2.2 - 2.5. 2.6 is DTM soon too.

  • 11 minor enhancements:

    • Added –show-skips option to show skips at end of run but not require –verbose. (MSP-Greg)

    • Added Minitest.seed, the random seed used by the run.

    • Calling `srand Minitest.seed` before all shuffles to ensure determinism.

    • Extended #stub to handle kwargs for both block and call args. (SampsonCrowley)

    • Extended Mock#__call to display kwargs.

    • Extended Mock#expect to record kwargs.

    • Extended Mock#method_missing to take kwargs & compare them against expected.

    • Mock#method_missing displays better errors on arity mismatch.

    • Removed minor optimization removing empty suites before run.

    • Simplified test randomization (test order will change even with fixed seed).

    • assert_match now returns the MatchData on success. (Nakilon)

  • 3 bug fixes:

    • (Re)Fixed marshalling of exceptions, neutering them in 2 passes.

    • Fixed more problems with rdoc.

    • Had to patch up mock and stub to deal with <=2.7 kwargs oddities

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actioncable (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actionmailbox (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

↗️ actionmailer (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actionpack (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Security Advisories 🚨

🚨 Possible XSS Vulnerability in Action Pack

There is a possible XSS vulnerability in Rails / Action Pack. This vulnerability has been
assigned the CVE identifier CVE-2022-22577.

Versions Affected: >= 5.2.0
Not affected: < 5.2.0
Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1

Impact

CSP headers were only sent along with responses that Rails considered as
"HTML" responses. This left API requests without CSP headers, which could
possibly expose users to XSS attacks.

Releases

The FIXED releases are available at the normal locations.

Workarounds

Set a CSP for your API responses manually.

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • Allow Content Security Policy DSL to generate for API responses.

    Tim Wade

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actiontext (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actionview (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Security Advisories 🚨

🚨 Possible XSS Vulnerability in Action View tag helpers

There is a possible XSS vulnerability in Action View tag helpers. Passing
untrusted input as hash keys can lead to a possible XSS vulnerability. This
vulnerability has been assigned the CVE identifier CVE-2022-27777.

Versions Affected: ALL
Not affected: NONE
Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1

Impact

If untrusted data is passed as the hash key for tag attributes, there is a
possibility that the untrusted data may not be properly escaped which can
lead to an XSS vulnerability.

Impacted code will look something like this:

check_box_tag('thename', 'thevalue', false, aria: { malicious_input => 'thevalueofaria' })

Where the "malicious_input" variable contains untrusted data.

All users running an affected release should either upgrade or use one of the
workarounds immediately.

Releases

The FIXED releases are available at the normal locations.

Workarounds

Escape the untrusted data before using it as a key for tag helper methods.

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • Fix and add protections for XSS in ActionView::Helpers and ERB::Util.

    Escape dangerous characters in names of tags and names of attributes in the tag helpers, following the XML specification. Rename the option :escape_attributes to :escape, to simplify by applying the option to the whole tag.

    Álvaro Martín Fraguas

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activejob (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activemodel (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activerecord (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Security Advisories 🚨

🚨 Possible RCE escalation bug with Serialized Columns in Active Record

There is a possible escalation to RCE when using YAML serialized columns in
Active Record. This vulnerability has been assigned the CVE identifier
CVE-2022-32224.

Versions Affected: All.
Not affected: None
Fixed Versions: 7.0.3.1, 6.1.6.1, 6.0.5.1, 5.2.8.1

Impact

When serialized columns that use YAML (the default) are deserialized, Rails
uses YAML.unsafe_load to convert the YAML data in to Ruby objects. If an
attacker can manipulate data in the database (via means like SQL injection),
then it may be possible for the attacker to escalate to an RCE.

Impacted Active Record models will look something like this:

class User < ApplicationRecord
  serialize :options       # Vulnerable: Uses YAML for serialization
  serialize :values, Array # Vulnerable: Uses YAML for serialization
  serialize :values, JSON  # Not vulnerable
end

All users running an affected release should either upgrade or use one of the
workarounds immediately.

Releases

The FIXED releases are available at the normal locations.

The released versions change the default YAML deserializer to use
YAML.safe_load, which prevents deserialization of possibly dangerous
objects. This may introduce backwards compatibility issues with existing
data.

In order to cope with that situation, the released version also contains two
new Active Record configuration options. The configuration options are as
follows:

  • config.active_storage.use_yaml_unsafe_load

When set to true, this configuration option tells Rails to use the old
"unsafe" YAML loading strategy, maintaining the existing behavior but leaving
the possible escalation vulnerability in place. Setting this option to true
is not recommended, but can aid in upgrading.

  • config.active_record.yaml_column_permitted_classes

The "safe YAML" loading method does not allow all classes to be deserialized
by default. This option allows you to specify classes deemed "safe" in your
application. For example, if your application uses Symbol and Time in
serialized data, you can add Symbol and Time to the allowed list as follows:

config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]

Workarounds

There are no feasible workarounds for this issue, but other coders (such as
JSON) are not impacted.

Release Notes

6.1.7 (from changelog)

  • Symbol is allowed by default for YAML columns

    Étienne Barrié

  • Fix ActiveRecord::Store to serialize as a regular Hash

    Previously it would serialize as an ActiveSupport::HashWithIndifferentAccess which is wasteful and cause problem with YAML safe_load.

    Jean Boussier

  • Fix PG.connect keyword arguments deprecation warning on ruby 2.7

    Fixes #44307.

    Nikita Vasilevsky

6.1.6.1 (from changelog)

  • Change ActiveRecord::Coders::YAMLColumn default to safe_load

    This adds two new configuration options The configuration options are as follows:

    • config.active_storage.use_yaml_unsafe_load

    When set to true, this configuration option tells Rails to use the old "unsafe" YAML loading strategy, maintaining the existing behavior but leaving the possible escalation vulnerability in place. Setting this option to true is not recommended, but can aid in upgrading.

    • config.active_record.yaml_column_permitted_classes

    The "safe YAML" loading method does not allow all classes to be deserialized by default. This option allows you to specify classes deemed "safe" in your application. For example, if your application uses Symbol and Time in serialized data, you can add Symbol and Time to the allowed list as follows:

    config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]
    

    [CVE-2022-32224]

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activestorage (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • Respect Active Record's primary_key_type in Active Storage migrations. Backported from 7.0.

    fatkodima

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activesupport (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • Fix and add protections for XSS in ActionView::Helpers and ERB::Util.

    Add the method ERB::Util.xml_name_escape to escape dangerous characters in names of tags and names of attributes, following the specification of XML.

    Álvaro Martín Fraguas

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ concurrent-ruby (indirect, 1.1.9 → 1.1.10) · Repo · Changelog

Release Notes

1.1.10

concurrent-ruby:

  • (#951) Set the Ruby compatibility version at 2.2
  • (#939, #933) The caller_runs fallback policy no longer blocks reads from the job queue by worker threads
  • (#938, #761, #652) You can now explicitly prune_pool a thread pool (Sylvain Joyeux)
  • (#937, #757, #670) We switched the Yahoo stock API for demos to Alpha Vantage (Gustavo Caso)
  • (#932, #931) We changed how SafeTaskExecutor handles local jump errors (Aaron Jensen)
  • (#927) You can use keyword arguments in your initialize when using Async (Matt Larraz)
  • (#926, #639) We removed timeout from TimerTask because it wasn't sound, and now it's a no-op with a warning (Jacob Atzen)
  • (#919) If you double-lock a re-entrant read-write lock, we promote to locked for writing (zp yuan)
  • (#915) monotonic_time now accepts an optional unit parameter, as Ruby's clock_gettime (Jean Boussier)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ erubi (indirect, 1.10.0 → 1.11.0) · Repo · Changelog

Release Notes

1.11.0 (from changelog)

* Support :freeze_template_literals option for configuring whether to add .freeze to template literal strings (casperisfine) (#33)

* Support :chain_appends option for chaining appends to the buffer variable (casperisfine, jeremyevans) (#32)

* Avoid unnecessary defined? usage on Ruby 3+ when using the :ensure option (jeremyevans)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ i18n (indirect, 1.10.0 → 1.12.0) · Repo · Changelog

Release Notes

1.12.0

What's Changed

  • Revert "Add support for CLDR data in I18n::Backend::Pluralization" by @radar in #633 -- this was causing breaking changes unintentionally.

Full Changelog: v1.11.0...v1.12.0

1.11.0

What's Changed

New Contributors

Full Changelog: v1.10.0...v1.11.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ mail (indirect, 2.7.1 → 2.8.0) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ rack (indirect, 2.2.3 → 2.2.4) · Repo · Changelog

Security Advisories 🚨

🚨 Denial of Service Vulnerability in Rack Multipart Parsing

There is a possible denial of service vulnerability in the multipart parsing
component of Rack. This vulnerability has been assigned the CVE identifier
CVE-2022-30122.

Versions Affected: >= 1.2
Not affected: < 1.2
Fixed Versions: 2.0.9.1, 2.1.4.1, 2.2.3.1

Impact

Carefully crafted multipart POST requests can cause Rack's multipart parser to
take much longer than expected, leading to a possible denial of service
vulnerability.

Impacted code will use Rack's multipart parser to parse multipart posts. This
includes directly using the multipart parser like this:

params = Rack::Multipart.parse_multipart(env)

But it also includes reading POST data from a Rack request object like this:

p request.POST # read POST data
p request.params # reads both query params and POST data

All users running an affected release should either upgrade or use one of the
workarounds immediately.

Workarounds

There are no feasible workarounds for this issue.

🚨 Possible shell escape sequence injection vulnerability in Rack

There is a possible shell escape sequence injection vulnerability in the Lint
and CommonLogger components of Rack. This vulnerability has been assigned the
CVE identifier CVE-2022-30123.

Versions Affected: All.
Not affected: None
Fixed Versions: 2.0.9.1, 2.1.4.1, 2.2.3.1

Impact

Carefully crafted requests can cause shell escape sequences to be written to
the terminal via Rack's Lint middleware and CommonLogger middleware. These
escape sequences can be leveraged to possibly execute commands in the victim's
terminal.

Impacted applications will have either of these middleware installed, and
vulnerable apps may have something like this:

use Rack::Lint

Or

use Rack::CommonLogger

All users running an affected release should either upgrade or use one of the
workarounds immediately.

Workarounds

Remove these middleware from your application

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ rack-test (indirect, 1.1.0 → 2.0.2) · Repo · Changelog

Release Notes

2.0.2 (from changelog)

  • Bug fixes:
    • Fix additional incompatible character encodings error when building uploaded bodies (Jeremy Evans #311)

2.0.1 (from changelog)

  • Bug fixes:
    • Fix incompatible character encodings error when building uploaded file bodies (Jeremy Evans #308 #309)

2.0.0 (from changelog)

  • Breaking changes:

    • Digest authentication support is now deprecated, as it relies on digest authentication support in rack, which has been deprecated (Jeremy Evans #294)
    • Rack::Test::Utils.build_primitive_part no longer handles array values (Jeremy Evans #292)
    • Rack::Test::Utils module methods other than build_nested_query and build_multipart are now private methods (Jeremy Evans #297)
    • Rack::MockSession has been combined into Rack::Test::Session, and remains as an alias to Rack::Test::Session, but to keep some backwards compatibility, Rack::Test::Session.new will accept a Rack::Test::Session instance and return it (Jeremy Evans #297)
    • Previously protected methods in Rack::Test::Cookie{,Jar} are now private methods (Jeremy Evans #297)
    • Rack::Test::Methods no longer defines build_rack_mock_session, but for backwards compatibility, build_rack_test_session will call build_rack_mock_session if it is defined (Jeremy Evans #297)
    • Rack::Test::Methods::METHODS is no longer defined (Jeremy Evans #297)
    • Rack::Test::Methods#_current_session_names has been removed (Jeremy Evans #297)
    • Headers used/accessed by rack-test are now lower case, for rack 3 compliance (Jeremy Evans #295)
    • Frozen literal strings are now used internally, which may break code that mutates static strings returned by rack-test, if any (Jeremy Evans #304)
  • Minor enhancements:

    • rack-test now works with the rack main branch (what will be rack 3) (Jeremy Evans #280 #292)
    • rack-test only loads the parts of rack it uses when running on the rack main branch (what will be rack 3) (Jeremy Evans #292)
    • Development dependencies have been significantly reduced, and are now a subset of the development dependencies of rack itself (Jeremy Evans #292)
    • Avoid creating multiple large copies of uploaded file data in memory (Jeremy Evans #286)
    • Specify HTTP/1.0 when submitting requests, to avoid responses with Transfer-Encoding: chunked (Jeremy Evans #288)
    • Support :query_params in rack environment for parameters that are appended to the query string instead of used in the request body (Jeremy Evans #150 #287)
    • Reduce required ruby version to 2.0, since tests run fine on Ruby 2.0 (Jeremy Evans #292)
    • Support :multipart env key for request methods to force multipart input (Jeremy Evans #303)
    • Force multipart input for request methods if content type starts with multipart (Jeremy Evans #303)
    • Improve performance of Utils.build_multipart by using an append-only design (Jeremy Evans #304)
    • Improve performance of Utils.build_nested_query for array values (Jeremy Evans #304)
  • Bug fixes:

    • The CONTENT_TYPE of multipart requests is now respected, if it starts with multipart/ (Tom Knig #238)
    • Work correctly with responses that respond to to_a but not to_ary (Sergio Faria #276)
    • Raise an ArgumentError instead of a TypeError when providing a StringIO without an original filename when creating an UploadedFile (Nuno Correia #279)
    • Allow combining both an UploadedFile and a plain string when building a multipart upload (Mitsuhiro Shibuya #278)
    • Fix the generation of filenames with spaces to use path escaping instead of regular escaping, since path unescaping is used to decode it (Muir Manders, Jeremy Evans #275 #284)
    • Rewind tempfile used for multipart uploads before it is submitted to the application (Jeremy Evans, Alexander Dervish #261 #268 #286)
    • Fix Rack::Test.encoding_aware_strings to be true only on rack 1.6+ (Jeremy Evans #292)
    • Make Rack::Test::CookieJar#valid? return true/false (Jeremy Evans #292)
    • Cookies without a domain attribute no longer are submitted to requests for subdomains of that domain, for RFC 6265 compliance (Jeremy Evans #292)
    • Increase required rack version to 1.3, since tests fail on rack 1.2 and below (Jeremy Evans #293)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ railties (indirect, 6.1.5 → 6.1.7) · Repo · Changelog

Release Notes

6.1.7 (from changelog)

  • No changes.

6.1.6.1 (from changelog)

  • No changes.

6.1.5.1 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ sprockets (indirect, 4.0.3 → 4.2.0) · Repo · Changelog

Release Notes

4.1.1

  • Fix Sprockets::Server to return response headers to compatible with with Rack::Lint 2.0.

Full Changelog: v4.1.0...v4.1.1

4.1.0

What's Changed

New Contributors

Full Changelog: v4.0.3...v4.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ tzinfo (indirect, 2.0.4 → 2.0.5) · Repo · Changelog

Release Notes

2.0.5

  • Changed DateTime results to always use the proleptic Gregorian calendar. This affects DateTime results prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15.
  • Added support for eager loading all the time zone and country data by calling either TZInfo::DataSource#eager_load! or TZInfo.eager_load!. Compatible with Ruby On Rails' eager_load_namespaces. #129.
  • Ignore the SECURITY file from Arch Linux's tzdata package. #134.

TZInfo v2.0.5 on RubyGems.org

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ zeitwerk (indirect, 2.5.4 → 2.6.6) · Repo · Changelog

Release Notes

2.6.6 (from changelog)

  • The new eager_load_namespace had a bug when eager loading certain namespaces with collapsed directories. This has been fixed.

2.6.5 (from changelog)

  • Controlled errors in a couple of situations:

    • Attempting to eager load or reload without previously invoking setup now raises Zeitwerk::SetupRequired.

    • 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.4 (from changelog)

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.3 (from changelog)

  • 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.2 (from changelog)

  • 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.1 (from changelog)

  • Zeitwerk::Loader#dirs allows you to instrospect the root directories configured in the receiver. Please check its documentation for details.

2.6.0 (from changelog)

  • 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.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

🆕 date (added, 3.3.3)

🆕 net-imap (added, 0.3.2)

🆕 net-pop (added, 0.1.2)

🆕 net-protocol (added, 0.2.1)

🆕 net-smtp (added, 0.3.3)

🆕 timeout (added, 0.3.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
depfu[bot] commented 1 year ago

Closed in favor of #95.