They were initially made frozen to avoid false positives for cases such
as:
str = str.dup if str.frozen?
But this may cause bugs and is generally confusing for users.
[Feature #20205]
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
This test randomly fails due to the bug reported in [Bug #20314], where
the two timeouts are too close so that they can expire at the same time.
As a workaround, this change increases the time difference between
timeouts. This will reduce the probability of simultaneous expirations
and lower flakiness.
(https://github.com/ruby/reline/pull/707)
* Implement the redo command
* Commented out a test that does not pass
* Changed key assignment for redo from "\C-[" to "\C-g"
* Changed redo key assignment from `\C-g` to `\M-\C-_`
* Revert the first implemantation
* Implemented redo by sharing `@past_lines` between undo and redo
* Fixed the index of past_lines that is updated when the cursor is moved
* Fixed deletion of the redo history in regular input
* Renamed variables: past_lines -> input_lines
* Rename @position to @input_lines_position
* Deleted unused variables: `@old_byte_pointer` and `@old_line_index`
https://github.com/ruby/reline/commit/0b2d9fab5f
Since #10209 we've been noticing that on macos after running `make
clean` the `coroutine/arm64/Context.S` file is missing, causing
subsequent make calls to fail because `Context.S` is needed to build
`Context.o`.
The reason this is happening is because macos is case-insensitive so the
`.s` looks for `coroutine/arm64/Context.s` and finds
`coroutine/arm64/Context.s`. This does not happen on linux because the
filesystem is case sensitive.
I attempted to use `find` because it is case sensitive regardless of
filesystem, but it was a lot slower than `rm` since we can't pass
multiple file names the same way to `find`.
Reverting this small part of #10209 fixes the issue for macos and it
wasn't clear that those changes were strictly necessary for the rest of
the PR.
We changed the original code to use `rm` instead of `delete` because it
is not standarized on POSIX.
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.