Aaron Patterson
abce8583e2
[ruby/yarp] Fix heredocs inside %W and %w lists
...
The problem was that we were treating heredoc bodies as part of the %W
list because we didn't push the scanning cursor past the heredoc after
lexing out the here doc. To fix this, we changed the whitespace
scanning function to quit scanning when it reaches a newline but only in
the case that a heredoc is present.
Additionally, we need to prevent double counting newlines in the case of
a heredoc. For example:
```ruby
%W(<<foo 123)
foo
```
The newline after the `)` is counted as part of scanning the heredoc, so
we added logic to prevent double counting the newline when scanning the
rest of the %W list.
https://github.com/ruby/yarp/commit/eb090d8126
Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>
2023-07-20 14:58:11 +00:00
Nobuyoshi Nakada
419fbc77e0
[rubygems/rubygems] Clear `YAML` constant if it was undefined previously
...
https://github.com/rubygems/rubygems/commit/31d0311258
2023-07-19 23:20:54 +00:00
tomoya ishida
7380c73af4
[ruby/reline] Add assertion to auto_indent_proc's parameter, add
...
Ctrl-d exit test
(https://github.com/ruby/reline/pull/574 )
* Add auto_indent_proc's parameter assertion in multiline_repl
* Add rendering test for Ctrl-d exit
https://github.com/ruby/reline/commit/46db71132a
2023-07-19 13:31:17 +00:00
tomoya ishida
ca561480ea
[ruby/reline] Always set ANSI CSI keybindings for Home, End, and
...
Arrow.
(https://github.com/ruby/reline/pull/569 )
https://github.com/ruby/reline/commit/f363a43a45
2023-07-19 13:25:58 +00:00
Nobuyoshi Nakada
a3a74771f2
Add a corner case for `return`
2023-07-19 12:42:20 +09:00
tomoya ishida
b400307923
[ruby/reline] Add missing `close` to test_rendering.rb
...
(https://github.com/ruby/reline/pull/573 )
https://github.com/ruby/reline/commit/7cd817036e
2023-07-18 20:31:40 +00:00
Peter Zhu
ecbedf9bf1
Remove assumption about object order
...
The address of objects can't be assumed since a later object may be
allocate in a swept slot.
2023-07-18 14:52:37 -04:00
Nobuyoshi Nakada
fe4d906f5f
[Bug #19774 ] Fix segfault at `return` in `END`
2023-07-19 03:40:05 +09:00
dependabot[bot]
ac7d34026a
[rubygems/rubygems] Bump rb-sys
...
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys ) from 0.9.58 to 0.9.79.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases )
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.58...v0.9.79 )
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
https://github.com/rubygems/rubygems/commit/097ae727b7
2023-07-18 16:53:03 +00:00
Nobuyoshi Nakada
9c94db7cfc
Add tests for `return` in `BEGIN` and `END` blocks
2023-07-19 00:43:25 +09:00
Stan Lo
d6ad334d6e
[ruby/irb] Reduce boilerplate code in RubyLexTest
...
(https://github.com/ruby/irb/pull/644 )
* Avoid initialising Row at every test input
* Extract common assertion patterns into methods
* Remove unnecessary PromptRow strcut and boilerplate code
https://github.com/ruby/irb/commit/1ba586c0c6
2023-07-18 15:18:58 +00:00
Hiroshi SHIBATA
56c8dab468
[flori/json] Skip BigDecimal tests when it's missing to load
...
https://github.com/flori/json/commit/3dd36c6077
2023-07-18 12:25:55 +09:00
Nobuyoshi Nakada
9f51810f34
[flori/json] Skip unsupported test on JRuby
...
https://github.com/flori/json/commit/7138bf32c7
2023-07-18 12:25:54 +09:00
Hiroshi SHIBATA
b368990ce6
[ruby/psych] Skip BigDecimal tests when it's missing to load
...
https://github.com/ruby/psych/commit/e1dbfae7a6
2023-07-18 02:55:47 +00:00
Nobuyoshi Nakada
105bdba899
Fix logarithm of 0 with base
2023-07-17 23:57:11 +09:00
Nobuyoshi Nakada
2476b1ee0b
objspace is not used in parent process [ci skip]
2023-07-17 20:44:35 +09:00
Nobuyoshi Nakada
f1adc5866a
Fix up to require objspace
2023-07-17 19:50:47 +09:00
Nobuyoshi Nakada
b998e6b79d
Run `Process.warmup` tests in separate processes
2023-07-17 19:49:00 +09:00
Jean Boussier
fa30b99c34
Implement Process.warmup
...
[Feature #18885 ]
For now, the optimizations performed are:
- Run a major GC
- Compact the heap
- Promote all surviving objects to oldgen
Other optimizations may follow.
2023-07-17 11:20:15 +02:00
Nobuyoshi Nakada
5c77402d88
Fix null pointer access in Ripper#initialize
...
In `rb_ruby_ripper_parser_allocate`, `r->p` is NULL between creating
`self` and `parser_params` assignment. As GC can happen there, the
typed-data functions for it need to consider the case.
2023-07-16 15:41:10 +09:00
tomoya ishida
be98bfc4ee
[ruby/irb] Indent multiline percent literals
...
(https://github.com/ruby/irb/pull/643 )
https://github.com/ruby/irb/commit/18bb4022a9
2023-07-15 18:12:05 +00:00
Tom Stuart
de68e240c7
Allow -1 as the value of `--backtrace-limit` option
...
-1 is a legitimate backtrace limit — in fact, it’s the default — so it
should be possible to provide it with the `--backtrace-limit` option.
2023-07-16 00:39:01 +09:00
Nobuyoshi Nakada
125b4461df
Test that command line `--backtrace-limit` overrides RUBYOPT
...
Co-authored-by: Tom Stuart <hi@tomstu.art>
2023-07-16 00:39:01 +09:00
alexandre184
e5825de7c9
[Bug #19769 ] Fix range of size 1 in `String#tr`
2023-07-15 16:36:53 +09:00
Marcelo Pereira
f15123c34c
Fix stack trace for rescued StopIteration
2023-07-15 15:24:43 +09:00
Jeremy Evans
5d4fff8456
Tighten Time.new(string) parsing
...
Disallow:
* Only year-month
* Only year-month-day
* Preceding whitespace
* Trailing whitespace
Fixes [Bug #19293 ]
2023-07-13 16:49:39 -07:00
Stan Lo
4999a53fe9
[ruby/irb] Unpend RDoc dialog related tests
...
(https://github.com/ruby/irb/pull/640 )
* Unpend rdoc dialog tests
Without these tests, we don't have any coverage on autocompletion's rdoc
dialog, which is what caused #638 to happen.
* Pull ri doc on CI for the doc dialog test
* Assert different screen result on CI and local machine
https://github.com/ruby/irb/commit/3ac96be660
2023-07-13 16:52:13 +00:00
Nobuyoshi Nakada
9c1fe9064c
[Feature #19757 ] Add new API `rb_data_define`
2023-07-13 17:55:55 +09:00
Hiroshi SHIBATA
3ef6364a98
Move bsearch test with Bigdecimal under the test_bigdecimal.rb
...
When we extract bigdecimal as bundled gems, this test will be failed
with `make test-all`.
2023-07-13 14:01:28 +09:00
Nobuyoshi Nakada
5dd969892f
Wait for sleepr thread to finish not to leak
2023-07-13 13:12:52 +09:00
Jemma Issroff
a02f5eb56a
YARP resync ( #8059 )
2023-07-12 12:46:38 -04:00
Ryo Kajiwara
4b6d667c63
[ruby/openssl] Add support for raw private/public keys
...
(https://github.com/ruby/openssl/pull/646 )
Add OpenSSL::PKey.new_raw_private_key, #raw_private_key and public
equivalents. These methods are useful for importing and exporting keys
that support "raw private/public key". Currently, OpenSSL implements
X25519/X448 and Ed25519/Ed448 keys.
[rhe: rewrote commit message]
https://github.com/ruby/openssl/commit/3f29525618
Co-authored-by: Bart de Water <bartdewater@gmail.com>
2023-07-12 23:40:58 +09:00
Peter Zhu
b90c48b1e2
Add comment to test
...
Add comment for 7299c8c0f1
.
2023-07-12 09:29:54 -04:00
Nobuyoshi Nakada
761662bbea
Revert previous commit [ci skip]
...
This reverts commit 074bf01e13
, "Test
`Comparable#clamp` with inverse arguments as well as a Range".
The test is already in another method.
2023-07-12 13:43:25 +09:00
Nobuyoshi Nakada
074bf01e13
Test `Comparable#clamp` with inverse arguments as well as a Range
2023-07-12 13:31:19 +09:00
Peter Zhu
7299c8c0f1
Try to fix flaky GC test
...
assert_not_nil could allocate objects which may trigger the major GC, so
don't run the assertions until the major GC has been ran.
2023-07-11 15:05:10 -04:00
Jeremy Evans
3874381c44
Fix autosplat conditions to handle ruby2_keywords case
...
Autosplat should not occur if there are two arguments but second
argument is an array containing a ruby2_keywords splat. Only
autosplat if a single argument to be yielded to the block, and there
is no splatted flagged keyword hash passed.
Fixes [Bug #19759 ]
2023-07-10 10:06:23 -07:00
Jemma Issroff
53c5601565
[ruby/yarp] Fix endless method definitions binding power to accept args ( #8051 )
2023-07-10 10:54:12 -04:00
Nobuyoshi Nakada
c8d0470bb0
Use `File::NULL` instead of hard coded null device names
2023-07-10 19:21:47 +09:00
Nobuyoshi Nakada
e2257831ab
[Bug #19763 ] Raise same message exception for regexp
2023-07-09 16:21:02 +09:00
tomoya ishida
02f9b685e8
[ruby/reline] Ignore unhandled escape sequences
...
(https://github.com/ruby/reline/pull/522 )
* Add unassigned escape sequence matcher to KeyStroke
* Do not insert ESC and unassigned ESC+key to input buffer
2023-07-08 08:41:30 +00:00
Stan Lo
24d9e21f84
[ruby/reline] Reduce direct references to `Reline::IOGate`
...
(https://github.com/ruby/reline/pull/566 )
* Avoid referencing IOGate from IOGate classes
The only time those classes being used is when themselves being the IOGate.
So when referencing to IOGate, it's better to use `self` instead.
* Avoid referencing to IOGate from LineEditor directly
* Avoid referencing to IOGate from Core directly
* Reference to Reline.core directly
* Replace Reline::IOGate with Reline.core.io_gate
2023-07-07 17:27:25 +00:00
Jemma Issroff
06c2d3e0a0
Resync YARP ( #8036 )
...
It got out of sync again. After this re-sync, it should happen
cherry-picking automatically.
2023-07-06 13:26:26 -04:00
Hiroshi SHIBATA
d287d8591c
[rubygems/rubygems] Avoid to use Base64 library because I have a plan to base64 gem to bundled gems in ruby/ruby.
...
https://github.com/rubygems/rubygems/commit/221797cfd1
2023-07-06 05:01:29 +00:00
Jemma Issroff
bfb933371d
Manual YARP resync
2023-07-05 16:58:55 -04:00
tomoya ishida
6f9d1b4b0f
[ruby/reline] Update Relin::IOGate dinamically when it is needed
...
(https://github.com/ruby/reline/pull/560 )
https://github.com/ruby/reline/commit/4680d1c9e0
2023-07-05 20:21:13 +00:00
cryptogopher
10f59dcbcd
[ruby/bigdecimal] Add .to_s('F') digit grouping for integer part
...
https://github.com/ruby/bigdecimal/commit/f63544d465
2023-07-05 20:15:52 +00:00
tomoya ishida
cd7166cc8f
[ruby/reline] Fix wrong byte_pointer passed to auto_indent_proc
...
(https://github.com/ruby/reline/pull/562 )
https://github.com/ruby/reline/commit/4348354604
2023-07-05 16:33:46 +00:00
Nobuyoshi Nakada
1f9618fc95
Remove stale YARP snapshort file [ci skip]
2023-07-05 20:37:54 +09:00
Stan Lo
f6af5a1128
[ruby/irb] Refactor eval history
...
(https://github.com/ruby/irb/pull/623 )
* Rename `ext/history.rb` to `ext/eval_history.rb`
To confusion with `lib/irb/history.rb`
* Add eval_history tests
* Rename eval_history's History to EvalHistory to avoid confusion
2023-07-04 15:17:41 +00:00