summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-12-17Add tests for `Queue#pop` with fiber scheduler. (#6953)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-12-16Clean up Ruby Shape APIJemma Issroff
Make printing shapes better, use a struct instead of specific methods for each field on a shape. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6942
2022-12-16[Feature #18033] Parse more strictly conformant with ISO-8601Nobuyoshi Nakada
* 4-digits or more is required as year * Minutes and seconds parts are not ommittable Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] Add `precision:` optionNobuyoshi Nakada
Which limits the precision of subsecond. Defaulted to 9, that means nanosecond. Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] More strict checksNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] Make Time.new parse time stringsNobuyoshi Nakada
`Time.new` now parses strings such as the result of `Time#inspect` and restricted ISO-8601 formats. Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16Unconditionally warn "unknown pack/unpack directive"Yusuke Endoh
[Bug #19150] Notes: Merged: https://github.com/ruby/ruby/pull/6948
2022-12-16Reject keyword arguments given to Enumerator::Product.newAkinori MUSHA
The use of keyword arguments should be reserved for future extension.
2022-12-16[ruby/irb] Prefer to use File.open instead of Kernel.openHiroshi SHIBATA
https://github.com/ruby/irb/commit/ed9e435a6b
2022-12-16fixed encoding tableKoichi Sasada
This reduces global lock acquiring for reading. https://bugs.ruby-lang.org/issues/18949 Notes: Merged: https://github.com/ruby/ruby/pull/6935
2022-12-15YJIT: Fix `obj.send(:call)`Alan Wu
All the method call types need to handle argument shifting in case they're called by `.send`, and we weren't handling that in `OPTIMIZED_METHOD_TYPE_CALL`. Lack of shifting caused the stack size assertion in gen_leave() to fail. Discovered by Rails CI: https://buildkite.com/rails/rails/builds/91705#018516c4-f8f8-469e-bc2d-ddeb25ca8317/1920-2067 Diagnosed with help from `@eileencodes` and `@k0kubun`. Notes: Merged: https://github.com/ruby/ruby/pull/6943 Merged-By: XrXr
2022-12-15Indicate if a shape is too_complex in ObjectSpace#dumpJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/6939
2022-12-15Fix Object Movement allocation in GCMatt Valentine-House
When moving Objects between size pools we have to assign a new shape. This happened during updating references - we tried to create a new shape tree that mirrored the existing tree, but based on the root shape of the new size pool. This causes allocations to happen if the new tree doesn't already exist, potentially triggering a GC, during GC. This commit changes object movement to look for a pre-existing new tree during object movement, and if that tree does not exist, we don't move the object to the new pool. This allows us to remove the shape allocation from update references. Co-Authored-By: Peter Zhu <peter@peterzhu.ca> Notes: Merged: https://github.com/ruby/ruby/pull/6938
2022-12-15Transition complex objects to "too complex" shapeJemma Issroff
When an object becomes "too complex" (in other words it has too many variations in the shape tree), we transition it to use a "too complex" shape and use a hash for storing instance variables. Without this patch, there were rare cases where shape tree growth could "explode" and cause performance degradation on what would otherwise have been cached fast paths. This patch puts a limit on shape tree growth, and gracefully degrades in the rare case where there could be a factorial growth in the shape tree. For example: ```ruby class NG; end HUGE_NUMBER.times do NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1) end ``` We consider objects to be "too complex" when the object's class has more than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and the object introduces a new variation (a new leaf node) associated with that class. For example, new variations on instances of the following class would be considered "too complex" because those instances create more than 8 leaves in the shape tree: ```ruby class Foo; end 9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) } ``` However, the following class is *not* too complex because it only has one leaf in the shape tree: ```ruby class Foo def initialize @a = @b = @c = @d = @e = @f = @g = @h = @i = nil end end 9.times { Foo.new } `` This case is rare, so we don't expect this change to impact performance of most applications, but it needs to be handled. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6931
2022-12-15Revert "Fix Object Movement allocation in GC"Peter Zhu
This reverts commit 9c54466e299aa91af225bc2d92a3d7755730948f. We're seeing crashes in Shopify CI after this commit.
2022-12-15Fix Object Movement allocation in GCMatt Valentine-House
When moving Objects between size pools we have to assign a new shape. This happened during updating references - we tried to create a new shape tree that mirrored the existing tree, but based on the root shape of the new size pool. This causes allocations to happen if the new tree doesn't already exist, potentially triggering a GC, during GC. This commit changes object movement to look for a pre-existing new tree during object movement, and if that tree does not exist, we don't move the object to the new pool. This allows us to remove the shape allocation from update references. Co-Authored-By: Peter Zhu <peter@peterzhu.ca> Notes: Merged: https://github.com/ruby/ruby/pull/6926
2022-12-15Disallow mixed usage of ... and */**Shugo Maeda
[Feature #19134] Notes: Merged: https://github.com/ruby/ruby/pull/6934
2022-12-15Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams
* Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-12-14[rubygems/rubygems] Clean up Indexer build files in testsNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/5479d99a1d
2022-12-14Add `Regexp.linear_time?` (#6901)TSUYUSATO Kitsune
Notes: Merged-By: makenowjust <make.just.on@gmail.com>
2022-12-14[ruby/reline] Fix a misparameter of RubyLex#set_input inHASUMI Hitoshi
termination_checker.rb (https://github.com/ruby/reline/pull/482) * Fix a misparameter of RubyLex#set_input in termination_checker.rb The keyword parameter `:context` of RubyLex#set_input became mandatory due to this commit: https://github.com/ruby/irb/pull/427/files#diff-612b926e42ed78aed1a889ac1944f7d22229b3a489cc08f837a7f75eca3d3399R51 Without my patch, tests that specify "--auto-indent" option in test_yamatanooroti fall into an infinite loop. This would need more explanation: - The infinite loop happens in Yamatanooroti::VTermTestCaseModule#sync see: https://github.com/aycabta/yamatanooroti/blob/v0.0.9/lib/yamatanooroti/vterm.rb#L60-L63 - `@pty_output.read_nonblock(1024)` actually returned an exception - However, this method doesn't anticipate such a situation - As a result, `startup_message` couldn't be resolved for good and the infinite loop happens - I think we would eventually have to fix yamatanooroti, though the inconsistency of the kwarg of "set_input" has to be fixed anyway The actual exception message that is raised but ignored silently in Yamatanooroti::VTermTestCaseModule#sync: ``` /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/irb-d30c0c994351/lib/irb/ruby-lex.rb:51:in `set_input': missing keyword: :context (ArgumentError) from /home/hasumi/work/ruby/reline/test/reline/yamatanooroti/termination_checker.rb:23:in `initialize' from /home/hasumi/work/ruby/reline/test/reline/yamatanooroti/multiline_repl:43:in `new' from /home/hasumi/work/ruby/reline/test/reline/yamatanooroti/multiline_repl:43:in `block in <main>' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/optparse.rb:1576:in `block in parse_in_order' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/optparse.rb:1559:in `catch' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/optparse.rb:1559:in `parse_in_order' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/optparse.rb:1553:in `order!' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/optparse.rb:1659:in `permute!' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/optparse.rb:1684:in `parse!' from /home/hasumi/work/ruby/reline/test/reline/yamatanooroti/multiline_repl:174:in `<main>' ``` Backtrace of an inifinite loop: ``` /home/hasumi/work/ruby/yamatanooroti/lib/yamatanooroti/vterm.rb:59:in `sleep': Interrupt from /home/hasumi/work/ruby/yamatanooroti/lib/yamatanooroti/vterm.rb:59:in `block in sync' from /home/hasumi/work/ruby/yamatanooroti/lib/yamatanooroti/vterm.rb:58:in `loop' from /home/hasumi/work/ruby/yamatanooroti/lib/yamatanooroti/vterm.rb:58:in `sync' from /home/hasumi/work/ruby/yamatanooroti/lib/yamatanooroti/vterm.rb:28:in `start_terminal' from /home/hasumi/work/ruby/reline/test/reline/yamatanooroti/test_rendering.rb:653:in `test_suppress_auto_indent_just_after_pasted' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testcase.rb:871:in `run_test' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testcase.rb:566:in `block (2 levels) in run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/fixture.rb:257:in `run_fixture' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/fixture.rb:292:in `run_setup' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testcase.rb:564:in `block in run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testcase.rb:563:in `catch' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testcase.rb:563:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:124:in `run_test' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:53:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:124:in `run_test' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:53:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:124:in `run_test' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:53:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:124:in `run_test' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/testsuite.rb:53:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnermediator.rb:67:in `run_suite' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnermediator.rb:45:in `block (2 levels) in run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnermediator.rb:102:in `with_listener' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnermediator.rb:41:in `block in run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnermediator.rb:39:in `catch' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnermediator.rb:39:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunner.rb:40:in `start_mediator' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunner.rb:25:in `start' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/ui/testrunnerutilities.rb:24:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/autorunner.rb:458:in `block in run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/autorunner.rb:514:in `change_work_directory' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/autorunner.rb:457:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit/autorunner.rb:66:in `run' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/test-unit-3.5.5/lib/test/unit.rb:518:in `block (2 levels) in <top (required)>' ``` * Fix mock object of Context The previous commit solved one problem, but it found the next problem. Following error message got from the command `RELINE_STDERR_TTY=error.log rake test_yamatanooroti`: ``` Reline is used by 24373 /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/irb-d30c0c994351/lib/irb/ruby-lex.rb:151:in `ripper_lex_without_warning': private method `local_variables' called for #<struct auto_indent_mode=true, workspace=nil> (NoMethodError) lvars_code = generate_local_variables_assign_code(context&.local_variables || []) ^^^^^^^^^^^^^^^^^ from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/irb-d30c0c994351/lib/irb/ruby-lex.rb:213:in `block in set_auto_indent' from /home/hasumi/work/ruby/reline/lib/reline/line_editor.rb:1721:in `process_auto_indent' from /home/hasumi/work/ruby/reline/lib/reline/line_editor.rb:1663:in `input_key' from /home/hasumi/work/ruby/reline/lib/reline.rb:346:in `block (3 levels) in inner_readline' from /home/hasumi/work/ruby/reline/lib/reline.rb:345:in `each' from /home/hasumi/work/ruby/reline/lib/reline.rb:345:in `block (2 levels) in inner_readline' from /home/hasumi/work/ruby/reline/lib/reline.rb:420:in `block in read_io' from /home/hasumi/work/ruby/reline/lib/reline.rb:390:in `loop' from /home/hasumi/work/ruby/reline/lib/reline.rb:390:in `read_io' from /home/hasumi/work/ruby/reline/lib/reline.rb:343:in `block in inner_readline' from /home/hasumi/work/ruby/reline/lib/reline.rb:341:in `loop' from /home/hasumi/work/ruby/reline/lib/reline.rb:341:in `inner_readline' from /home/hasumi/work/ruby/reline/lib/reline.rb:271:in `readmultiline' from /home/hasumi/.rbenv/versions/3.1.2/lib/ruby/3.1.0/forwardable.rb:238:in `readmultiline' from /home/hasumi/work/ruby/reline/test/reline/yamatanooroti/multiline_repl:185:in `<main>' ``` In irb/ruby-lex.rb, `context` is originally supposed to be an instance of IRB::Context with a public method `#local_variables`. However, the `context` in reline/test/reline/yamatanooroti/termination_checker.rb is a Struct that is a mock object with no `#local_variables` method. Thus, `rake test_yamatanooroti` no longer causes an infinite loop and an unexpected error with these two commits (at least in WITH_VTERM environment) * Name the Struct "MockIRBContext" to specify what it is for
2022-12-13[ruby/date] Implement Date#deconstruct_keys and DateTime#deconstruct_keyszverok
https://github.com/ruby/date/commit/6bb6d3a810
2022-12-13[ruby/openssl] Allow empty string to OpenSSL::Cipher#updateYusuke Nakamura
For some reasons, plaintext may be empty string. ref https://www.rfc-editor.org/rfc/rfc9001.html#section-5.8 https://github.com/ruby/openssl/commit/953592a29e
2022-12-13[ruby/openssl] Use SHA256 instead of SHA1 where needed in tests.Jarek Prokop
Systems such as RHEL 9 are moving away from SHA1 disabling it completely in default configuration. https://github.com/ruby/openssl/commit/32648da2f6
2022-12-13[Bug #19195] Allow optional newlines before closing parenthesisNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6916
2022-12-12[rubygems/rubygems] Bump rb-sys in ↵dependabot[bot]
/test/rubygems/test_gem_ext_cargo_builder/custom_name Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.46 to 0.9.48. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.46...v0.9.48) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12[ruby/irb] Group show_doc tests and update the expectationStan Lo
(https://github.com/ruby/irb/pull/479) https://github.com/ruby/irb/commit/bede04c14a
2022-12-12[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.46 to 0.9.48. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.46...v0.9.48) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12[ruby/irb] `show_doc` command should take non-string argument tooStan Lo
(https://github.com/ruby/irb/pull/478) Given that `show_doc` already supports syntax like `String#gsub`, it should be able to take it in non-string form too, like `edit` and `show_source` do. This ensures users can have a consistent syntax on argument between different commands.
2022-12-12[rubygems/rubygems] Prefer RbConfig::CONFIG['EXEEXT'] over hardcorded '.exe'Nobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/bc84b2d262
2022-12-12Make absent operator work at the end of the input stringYusuke Endoh
https://bugs.ruby-lang.org/issues/19104#change-100542 Notes: Merged: https://github.com/ruby/ruby/pull/6902
2022-12-12Merge RubyGems/Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/bfb0ae69776069155d2092702bfbb5a12617d85a Notes: Merged: https://github.com/ruby/ruby/pull/6906
2022-12-10MJIT: Compile methods in batches (#6900)Takashi Kokubun
* MJIT: Compile methods in batches * MJIT: make mjit-bindgen * MJIT: Fix RubyVM::MJIT tests Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-12-10Expose need_major_gc via GC.latest_gc_info (#6791)Mirek Klimos
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2022-12-10A negative denominator case in the Rational string parsing testNobuyoshi Nakada
2022-12-09[ruby/irb] Fix step command (https://github.com/ruby/irb/pull/477)Stan Lo
The current `next` pre-command workaround on IRB source stepping moves the location by 1 extra line. A better way is to make `debug` skip IRB frames completely, which is what this commit does. It also fixes the step command's test. The `|` in regexp was not escaped so it was always incorrectly matched.
2022-12-09YJIT: implement `getconstant` YARV instruction (#6884)Maxime Chevalier-Boisvert
* YJIT: implement getconstant YARV instruction * Constant id is not a pointer * Stack operands must be read after jit_prepare_routine_call Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-12-09Use rb_inspect instead of +PRIsVALUE for Object.inspectMatt Valentine-House
In order to preserve the values when TrueClass, FalseClass or NilClass are stored in ivars Notes: Merged: https://github.com/ruby/ruby/pull/6872
2022-12-09Merge net-protocol-0.2.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-09Merge Psych-5.0.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-09Merge fiddle-1.1.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-09Merge strscan-3.0.5Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-09Reapply the following commits related to extend timeout value.Hiroshi SHIBATA
66d1900423e6fb9774c2fe72dba8c2968b54d7ab 0686e4181d04dd911316a227753ceaa96d8c6533 1a63468831524f68e73cbb068071652c6486cfc6 e1fee7f949cb6719122672fa1081c60984a5339f 232e43fd52e53f667c2c290cffb4afa524889f0f Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-09Merge csv-3.2.6Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-08[ruby/irb] Add show_doc as an alias to the help commandStan Lo
(https://github.com/ruby/irb/pull/475) In the long-term, we want to align with `Pry`, `byebug` and `debug` to use the `help` command to list all commands, which is what `show_cmds` currently does. And `show_doc` will be the command to look up Ruby APIs. By aliasing `show_doc` to the current `help` now, users will have time to get use to it.
2022-12-08[ruby/irb] Gracefully handle missing command argumentStan Lo
(https://github.com/ruby/irb/pull/473) * Handle file loading commands' argument error gracefully Currently, if users don't provide an argument to `source`, `irb_load`, and `irb_require`, IRB raises `ArgumentError` with full stacktrace. This is confusing because it looks similar to when IRB has internal issues. The message also isn't helpful on helping users avoid the error. So in this commit, I add a new `CommandArgumentError` for commands to raise explicitly when users' input doesn't satisfy a command's argument requirement. * Gracefully handle `fg` command's argument requirement
2022-12-08Freeze singleton class, not its originAlan Wu
Previously, when we froze an object, we froze `RCLASS_ORIGIN(object.singleton_class)`, which didn't freeze `object.singleton_class` when it has some prepended modules. Origin iclass are internal objects and users can't interact with them through Kernel#freeze?, Kernel#freeze, or any mutation method that checks the frozen status. So we shouldn't touch the origin iclasses when the frozen status should be visible. [Bug #19169] Notes: Merged: https://github.com/ruby/ruby/pull/6869
2022-12-08[ruby/irb] Kill PTY process after test is finishedStan Lo
(https://github.com/ruby/irb/pull/471) The killing/waiting logic is borrowed from ruby/debug: https://github.com/ruby/debug/blob/ec5ae5aebd61a99dc84028d8dffa8e7e165c1ec6/test/support/test_case.rb#L107-L136
2022-12-08[ruby/irb] Add "show_cmds" command to list all commands'Stan Lo
descriptions (https://github.com/ruby/irb/pull/463) https://github.com/ruby/irb/commit/7e857655ac
2022-12-08ObjectSpace.dump_all: dump shapes as wellJean Boussier
I see several arguments in doing so. First they use a non trivial amount of memory, so for various memory profiling/mapping tools it is relevant to have visibility of the space occupied by shapes. Then, some pathological code can create a tons of shape, so it is valuable to have a way to have a way to observe shapes without having to compile Ruby with `SHAPE_DEBUG=1`. And additionally it's likely much faster to dump then this way than to use `RubyVM::Shape`. There are however a few open questions: - Shapes can't respect the `since:` argument. Not sure what to do when it is provided. Would probably make sense to not dump them. - Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`? - Maybe instead `dump_all` should take a `shapes: false` argument? Additionally, `ObjectSpace.dump_shapes` is added for the use case of debugging the evolution of the shape tree. Notes: Merged: https://github.com/ruby/ruby/pull/6868