Repository navigation
Conversation
The hooks are prepended to Kernel instead of aliased. There is a callback before each load as well as after, a nesting depth, and a trace file that prints loads as a tree. The require_relative callback, which no longer worked, takes its directory from caller_locations and is always on. Packaging moves to a gemspec, and the tests to Spectrum. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backload's
requireandloadcallbacks still worked on current Ruby, but therequire_relativeone raised ("Can't parse"), because it read the directory out of backtrace text whose format has changed.What's new
Kernel.backloading(feature, options). Until now there were only callbacks for afterwards. (Asked for in Output when require happens, not after #4.):depth, how many loads a load is inside of, so what required what can be shown as a tree. (Asked for in Source ofrequire, tree ofrequires with indentation? #2.)backload/trace: prints that tree with no code to write:ruby -rbackload/trace script.rb.Kernel.required_relativeis given the directory as a second argument; a callback taking only the feature still works. (Kernel.required_relative is missingrelativeas second param #5)What changed underneath
Module#prependinstead of alias chains.requireand friends stay private on objects and public onKernel.require_relativetakes its directory fromcaller_locations, and is always on.backload/require_relative,backload/requireandbackload/loadremain as files that just load Backload.autoloadis seen as therequireit makes (tested).Packaging and tests
backload.gemspec, Rakefile, CI on Ruby 3.1 to 4.0; version 0.3.0 (unreleased).The README is rewritten, which also takes in the typo fix from #3.
🤖 Generated with Claude Code