Repository navigation
Add the File::Constants module and its missing flag constants - #459
Merged
Merged
Conversation
File defined its open-mode and fnmatch flag constants directly on the class but had no File::Constants module, and was missing the flock operations (LOCK_SH/ LOCK_EX/LOCK_NB/LOCK_UN) and the NONBLOCK/NOCTTY/SYNC/SHARE_DELETE open flags, so File::Constants and File::LOCK_EX were uninitialized constants. File::Constants is now a module carrying the open-mode, flock and fnmatch flag constants (canonical Linux values — the specs only assert the names exist), and File includes it, so File::RDONLY, File::Constants::RDONLY and File::Constants.const_defined?(:RDONLY) all resolve. The names stay defined on File itself as well, so the integer-mode form of File.open (File::WRONLY | File::CREAT | File::TRUNC) keeps working. Verified against ruby 4.0.6. Full package coverage stays at 100.0%. Zero- regression rubyspec sweep; core/file/constants/constants_spec 0 -> 21, core/file/constants_spec 11 -> 19, core/file/open_spec 36 -> 38, core/file/ file_spec 4 -> 5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tannevaled
force-pushed
the
feat/cluster29
branch
from
August 25, 2026 22:33
8b60a7c to
baf5c05
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.
File defined its open-mode and fnmatch flag constants directly on the class but
had no
File::Constantsmodule, and was missing the flock operations(
LOCK_SH/LOCK_EX/LOCK_NB/LOCK_UN) and theNONBLOCK/NOCTTY/SYNC/SHARE_DELETEopen flags, soFile::ConstantsandFile::LOCK_EXwereuninitialized constants.
File::Constantsis now a module carrying the open-mode, flock and fnmatch flagconstants (canonical Linux values — the specs only assert the names exist), and
File includes it, so
File::RDONLY,File::Constants::RDONLYandFile::Constants.const_defined?(:RDONLY)all resolve. The names stay defined onFile itself as well, so the integer-mode form of
File.open(
File::WRONLY | File::CREAT | File::TRUNC) keeps working.Verified against ruby 4.0.6. Full package coverage stays at 100.0%.
Zero-regression rubyspec sweep;
core/file/constants/constants_spec0 → 21,core/file/constants_spec11 → 19,core/file/open_spec36 → 38,core/file/file_spec4 → 5.🤖 Generated with Claude Code