Repository navigation
Conversation
irb 1.18 opens with a banner - the small Ruby logo, "IRB v1.18.0 - Ruby <version>", a tip and the current directory - which CRuby shows once irb 1.18 is installed over the 1.16.0 it bundles. IronRuby vendored 1.16.0, verbatim, so it had none. Src/StdLib/ruby/4.0/irb and irb.rb are now irb 1.18.0's lib/, verbatim, with its LICENSE.txt; the default gemspec, VERSION.txt, install-bundled-gems.rb's note and the README say 1.18.0. This is newer than CRuby 4.0.9's bundled irb, as repl_type_completor is; reline stays 0.6.3, which irb 1.18 accepts. irb shows the banner only when started through a path ending in exe/irb, the gem's executable that MRI's binstub loads. Src/StdLib/bin/irb, which `ir -S irb`, iirb and `ironruby` at a terminal run, passes that path; irb takes only its basename from it. irb 1.18 finds open nestings with Prism instead of Ripper. On IronRuby's prism 2.0.0 it gives CRuby's answers for complete and unfinished def, do, case/in, if and class inputs; a piped `ir -S irb` session with a multi-line def runs, shows the banner and reports 1.18.0, and the TypeCompletor is still chosen.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
gen-default-gemspecs.rb writes each default gem's executables as one-line loaders into gems/<name>-<version>/exe, where Gem.bin_path looks; the irb one moves from irb-1.16.0 to irb-1.18.0 with the version. The loader itself is unchanged.
irb 1.18's startup banner says "Ruby #{RUBY_VERSION}", which on IronRuby read
"Ruby 4.0.0" - the language version, not the interpreter running. It now says
"IronRuby <IRONRUBY_VERSION> (<RUBY_VERSION>)", as RUBY_DESCRIPTION does; on
any other Ruby the line is upstream's. Patched in place in the vendored
irb/startup_message.rb and listed in VERSION.txt with the other patches.
…MRI does $stdout and $stderr handed Ruby's bytes to .NET's console stream, which passes them to WriteFile, and a console reads those in its output code page - 850 or 437 on most machines - so everything outside ASCII was mojibake: "ä" as two characters, and irb 1.18's banner logo as "ÔóÇÔí...". MRI writes to a console with WriteConsoleW. When standard output or error is a console (GetConsoleMode succeeds), IronRuby now decodes the bytes as UTF-8, Ruby's default external encoding on Windows, and writes them the same way; a character split across two writes is held until its last byte arrives. Redirected to a file or a pipe, the bytes go out unchanged, as before. Checked in a fresh conhost window with output code page 850, reading the screen back with ReadConsoleOutputCharacterW: "äöü ß €" and the banner's braille logo show as written. Redirected, the file holds the UTF-8 bytes.
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.
irb 1.18 opens with a banner: the small Ruby logo,
IRB v1.18.0 - Ruby <version>, a tip and the current directory. CRuby shows it as soon as irb 1.18 is installed over the bundled 1.16.0. IronRuby vendored 1.16.0, so it had no banner.Changes
Src/StdLib/ruby/4.0/irbandirb.rbare now irb 1.18.0'slib/, copied verbatim, together with itsLICENSE.txt.VERSION.txt, the note ininstall-bundled-gems.rband the README now say 1.18.0. That is newer than CRuby 4.0.9's bundled irb, asrepl_type_completoralready is. reline stays at 0.6.3, which irb 1.18 accepts.exe/irb.Src/StdLib/bin/irbtherefore passes that path. It coversir -S irb,iirbandironrubyat a terminal; irb uses only the basename.Checked
NestingParser.open_nestingsgives CRuby's results for complete and unfinisheddef,do,case/in,ifandclass.ir -S irbsession with a multi-linedefruns, shows the banner and reports 1.18.0.TypeCompletor.gen-default-gemspecs.rbwould also rewrite five unrelated gemspecs (ffi, fiddle, nokogiri, psych, puma), because the committed tree has drifted from the generator. They are not part of this PR.