Since `IO.new` accepts one or two positional arguments except for the
optional hash argument, exclude the optional hash argument from the
check for delegation to `IO.new`.
Most of the commands run by these specs actually prompt for user input
but for some reason `Open3` outside of Windows ignores that and goes on
with no user input. Windows does not like this.
This commit refactors these specs so that:
* They don't prompt for user input when not necessary.
* They pass proper user input when necessary.
As long as no user input is needed, most specs pass, so it allows to
remove the `:readline` tag from most of them.
https://github.com/rubygems/rubygems/commit/3dfabcdae4
Even if all gems are properly installed and no resolve is needed, we
recently started always reading all packages in `vendor/cache` and
extracting specifications from them.
This commit fixes the problem by longer making considering cached specs
the default and only enable them when a resolve is actually needed.
https://github.com/rubygems/rubygems/commit/edeb2c42bf
This was an offramp for generated etags to allow existing caches
to be served until people could upgrade. It has been about 6 months
since the transitional version was released, so we can remove this
transitional code now.
https://github.com/rubygems/rubygems/commit/4ec8cfe611
In some cases Prism was either not raising an appropriate `void value
expression` error, or raising that error when the syntax is considered
valid.
To fix this Prism needs to check whether we have other clauses on the
`begin` rather than just returning `cast->statements`.
* If the `cast->statements` are null and the `cast->ensure_clause` is
not null, set the code to `cast->ensure_clause`
* else
* If there is a `cast->rescue_clause`
* Check if `cast->statements` are null and `cast->rescue_clause->statements`
are null, and return `NULL`
* Check if there is an `else_clause`, and set the node to
`cast->else_clause`.
* Otherwise return `cast->statements` as the node
* return `cast->statements` as the node
See tests for test cases. Note I took these directly from CRuby so if
desired I can delete them since the test will now pass. This only fixes
one test in the `test_parse` file, taking failures from 14 to 13.
This fixes `TestParse#test_void_value_in_rhs` and is related to
issue #2791.
https://github.com/ruby/prism/commit/398152b412
I think this fixes the following random test failure that could not be
fixed for a long time:
```
1) Failure:
TestSymbol#test_inspect_under_gc_compact_stress [/home/chkbuild/chkbuild/tmp/build/20240522T003003Z/ruby/test/ruby/test_symbol.rb:126]:
<":testing"> expected but was
<":\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"">.
```
The value passed to this function is the return value of `rb_id2str`, so
it is never collected. However, if auto_compact is enabled, the string
may move and `RSTRING_PTR(str)` became invalid.
This change prevents the string from being moved by RB_GC_GUARD.
This reverts commit 8277cf0799145bed0c813bfcc187739f77b3102d.
This change break to build with `rbenv install ruby-dev` with the following error.
```
touch yjit/target/release/libyjit.a
transdb.h updated
./tool/darwin-ar: line 6: /nm: No such file or directory
./tool/darwin-ar: line 6: exec: /nm: cannot execute: No such file or directory
partial linking yjit/target/release/libyjit.a into yjit/target/release/libyjit.o
```