Repository navigation
Add signatures for Gem::Package::TarReader - #3214
Merged
Merged
Conversation
ksss
force-pushed
the
gem-package-tar-reader
branch
from
October 9, 2026 09:35
dc36b64 to
c59f2e9
Compare
Add minimal declarations for Gem::Package, Gem::Package::TarHeader, Gem::Package::TarReader, and Gem::Package::TarReader::Entry so that code using them does not hit unknown constant errors. Since core is loaded every time, only class declarations and constructors are included, like Gem::Uninstaller and Gem::DependencyInstaller. Methods can be added later when needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ksss
force-pushed
the
gem-package-tar-reader
branch
from
October 10, 2026 06:56
6905516 to
16344c4
Compare
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.
Add minimal signatures for
Gem::Package::TarReaderand the classes it depends on, so that code using them can be type checked without unknown constant errors.Gem::PackageGem::Package::TarHeader(initialize)Gem::Package::TarReader(self.new, which accepts a block)Gem::Package::TarReader::Entry(initialize)Why core and why minimal
Gem::Packageis not loaded by default (require "rubygems/package"is needed), so strictly speaking it could belong to stdlib likerandom-formatter. However, out of 240 files underlib/rubygems(Ruby 4.0.6), only 19 are loaded at startup and 12 more are registered as autoload. Splitting every non-loaded part of RubyGems into stdlib libraries would be too fine-grained.So this PR follows the existing convention for non-loaded RubyGems classes such as
Gem::Uninstaller,Gem::DependencyInstaller, andGem::StreamUI:requireget only minimal declarations (class declarations and constructors) in core, since core signatures are loaded every time.Methods can be added later when needed.
Docs were annotated with RDoc generated from Ruby 4.0.6's
lib/rubygems.🤖 Generated with Claude Code