Skip to content

Preserve nil from JRuby getpass at EOF - #156

Merged
nobu merged 1 commit into
ruby:masterfrom
OskarEichler:codex/jruby-getpass-eof
Sep 3, 2026
Merged

Preserve nil from JRuby getpass at EOF#156
nobu merged 1 commit into
ruby:masterfrom
OskarEichler:codex/jruby-getpass-eof

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

Use nil-safe chomp in both JRuby getpass implementations so EOF preserves MRI's nil contract instead of raising NoMethodError.

Reproduction

Focused external models return nil from gets; current code calls nil.chomp, while the candidate returns nil after restoring terminal output.

Verification

  • external EOF models for both JRuby paths
  • release/cumulative candidate: 36 tests / 143 assertions
  • current upstream: 35 tests / 144 assertions
  • syntax, package builds and Rails 8.1.3.1 loading

Compatibility

This restores MRI-compatible EOF behavior. JRuby was modeled but is unavailable locally; current upstream CI is green on JRuby. Prepared with AI-assisted source review; no repository tests were changed.

@nobu
nobu force-pushed the codex/jruby-getpass-eof branch from 4d041fa to f39627d Compare September 3, 2026 15:41
@nobu
nobu merged commit 4fed496 into ruby:master Sep 3, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants