Nobuyoshi Nakada
2652b0da6b
Harden SizedQueue#push timeout test
2022-08-19 00:16:44 +09:00
Jean Boussier
b0b9f7201a
rb_str_resize: Only clear coderange on truncation
...
If we are expanding the string or only stripping extra capacity
then coderange won't change, so clearing it is wasteful.
2022-08-18 10:09:08 +02:00
Jean Boussier
fe61cad749
Implement SizedQueue#push(timeout: sec)
...
[Feature #18944 ]
If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-18 10:07:37 +02:00
Peter Zhu
b4daf6e28e
Fix flaky test for GC thrashing
...
GC could be in an intermediate state after creating the objects, so we
should finish GC by running a minor GC.
2022-08-17 10:54:28 -04:00
Jean Boussier
3850113e20
[ruby/cgi] Implement CGI.url_encode
and CGI.url_decode
...
[Feature #18822 ]
Ruby is somewhat missing an RFC 3986 compliant escape method.
c2729c7f33
2022-08-16 19:12:03 +09:00
Nobuyoshi Nakada
5389c9813b
Update the excluding message for Psych [ci skip]
2022-08-16 13:49:28 +09:00
John Hawthorn
0608a9a086
Optimize Marshal dump/load for large (> 31-bit) FIXNUM ( #6229 )
...
* Optimize Marshal dump of large fixnum
Marshal's FIXNUM type only supports 31-bit fixnums, so on 64-bit
platforms the 63-bit fixnums need to be represented in Marshal's
BIGNUM.
Previously this was done by converting to a bugnum and serializing the
bignum object.
This commit avoids allocating the intermediate bignum object, instead
outputting the T_FIXNUM directly to a Marshal bignum. This maintains the
same representation as the previous implementation, including not using
LINKs for these large fixnums (an artifact of the previous
implementation always allocating a new BIGNUM).
This commit also avoids unnecessary st_lookups on immediate values,
which we know will not be in that table.
* Fastpath for loading FIXNUM from Marshal bignum
* Run update-deps
2022-08-15 16:14:12 -07:00
Peter Zhu
0264424d58
Add test for GC thrashing of young object creation
...
This test will prevent performance regressions like [Bug #18929 ].
2022-08-15 10:00:03 -04:00
Jeremy Evans
89aa09afaf
[ruby/rinda] Handle situations where IPv4 multicast is not available
...
Fixes [Bug #13864 ]
3cd620f38c
2022-08-15 14:11:52 +09:00
Nobuyoshi Nakada
844a0edbae
[Bug #18962 ] Do not read again once reached EOF
...
`Ripper::Lexer#parse` re-parses the source code with syntax errors
when `raise_errors: false`.
Co-Authored-By: tompng <tomoyapenguin@gmail.com>
2022-08-12 15:58:18 +09:00
Kouhei Yanagita
24e33b84b5
Remove Numeric#ceildiv
2022-08-12 15:57:52 +09:00
Kouhei Yanagita
4165fd0e76
Add Numeric#ceildiv and Integer#ceildiv
2022-08-12 15:57:52 +09:00
Nobuyoshi Nakada
cd1a0b3caa
Stop defining RUBY_ABI_VERSION
if released versions
...
As commented in include/ruby/internal/abi.h, since teeny versions of
Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role
in released versions of Ruby.
2022-08-12 15:57:25 +09:00
Jeremy Evans
49517b3bb4
Fix inspect for unicode codepoint 0x85
...
This is an inelegant hack, by manually checking for this specific
code point in rb_str_inspect. Some testing indicates that this is
the only code point affected.
It's possible a better fix would be inside of lower-level encoding
code, such that rb_enc_isprint would return false and not true for
codepoint 0x85.
Fixes [Bug #16842 ]
2022-08-11 08:47:29 -07:00
Jeremy Evans
cfb9624460
Fix Array#[] with ArithmeticSequence with negative steps ( #5739 )
...
* Fix Array#[] with ArithmeticSequence with negative steps
Previously, Array#[] when called with an ArithmeticSequence
with a negative step did not handle all cases correctly,
especially cases involving infinite ranges, inverted ranges,
and/or exclusive ends.
Fixes [Bug #18247 ]
* Add Array#slice tests for ArithmeticSequence with negative step to test_array
Add tests of rb_arithmetic_sequence_beg_len_step C-API function.
* Fix ext/-test-/arith_seq/beg_len_step/depend
* Rename local variables
* Fix a variable name
Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
2022-08-11 19:16:49 +09:00
Jeremy Evans
ff42e2359b
Revert "Add {Method,UnboundMethod}#{public?,private?,protected?}"
...
This reverts commit 2727815068
and
58dc8bf8f1
.
Visibility is an attribute of the method entry in a class, not an
attribute of the Method object.
Fixes [#18729 ]
Fixes [#18751 ]
Fixes [#18435 ]
2022-08-10 13:02:52 -07:00
Yusuke Endoh
3a58009066
[ruby/error_highlight] Make backtrace_location keyword work
...
We had to keep backtrace_location before opts is overwritten.
2735e4681a
2022-08-10 21:19:10 +09:00
Yusuke Endoh
99e7fa5b37
[ruby/error_highlight] Make ErrorHighlight.spot accept Exception ( https://github.com/ruby/error_highlight/pull/25 )
...
... and move things from core_ext.rb to base.rb.
This will confine CRuby-dependent things to ErrorHighlight.spot.
22d1dd7824
2022-08-10 18:37:13 +09:00
Hiroshi SHIBATA
44264b4fee
Merge rubygems/bundler HEAD.
...
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
dependabot[bot]
35b9cd1def
[rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
...
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys ) from 0.9.28 to 0.9.29.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases )
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.28...v0.9.29 )
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
77a945f0e8
2022-08-09 04:35:33 +09:00
Nobuyoshi Nakada
79fdf9712d
Tentatively exclude the test that triggers ruby/psych#572
2022-08-09 03:09:33 +09:00
dependabot[bot]
78bc2aae7f
[rubygems/rubygems] Bump rb-sys
...
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys ) from 0.9.28 to 0.9.29.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases )
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.28...v0.9.29 )
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
d5d96f6bae
2022-08-09 01:50:18 +09:00
Alexander Momchilov
9c13a6ce5f
[ruby/psych] Raise specific error when an anchor isn't defined
...
98fbd5247a
2022-08-09 01:33:34 +09:00
Alexander Momchilov
4b9cdf4e1c
[ruby/psych] Update to squiggly heredocs in the file
...
42b43de997
2022-08-09 01:33:33 +09:00
Alexander Momchilov
38ea6b30dc
[ruby/psych] Add test for missing anchor
...
5f08137ae6
2022-08-09 01:33:32 +09:00
Alexander Momchilov
ea1efdf32f
[ruby/psych] Add test for anchor reuse
...
The spec calls this a "reuse" of an anchor
https://yaml.org/spec/1.2.2/#71-alias-nodes
57e3b70a56
2022-08-09 01:33:31 +09:00
Alexander Momchilov
54219ae8c4
[ruby/psych] Raise specific error when aliases are not enabled
...
0c11ddcf46
2022-08-09 01:32:47 +09:00
Alexander Momchilov
71f89c2874
[ruby/psych] Don't hardcode expected alias names
...
b9ab19094f
2022-08-09 01:31:24 +09:00
Alexander Momchilov
0b7cfdca09
[ruby/psych] Test that recursive refs dump as aliases
...
d9f7289190
2022-08-09 01:31:23 +09:00
Alexander Momchilov
c851bced39
[ruby/psych] Clarify tests about parsing aliases
...
0bc30cb4cb
2022-08-09 01:31:22 +09:00
Nobuyoshi Nakada
e07d450dea
[ruby/date] Fix Time#to_datetime before calendar reform
...
Time is always in the proleptic Gregorian calendar.
Also DateTime#to_time should convert to the Gregorian calendar first,
before extracting its components.
https://bugs.ruby-lang.org/issues/18946#change-98527
b2aee75248
2022-08-08 23:50:17 +09:00
Nobuyoshi Nakada
5beb75ce8d
[ruby/rdoc] Allow multiple footnotes without in-between blank lines
...
e4e054e3ce
used four footnotes
without blank lines. And the ChangeLog generated from that commit
resulted in ``undefined method `parts' for nil`` error.
For now, let a footnote terminated by the next footnote mark.
Also refined the error message when undefined footnote is used.
a7f290130b
2022-08-08 01:12:49 +09:00
David Rodríguez
f310ac1cb2
[rubygems/rubygems] Include backtrace with crashes by default
...
3cc3bfd371
2022-08-05 16:37:03 +09:00
John Hawthorn
70b60d24b9
Fix inconsistency with opt_aref_with
...
opt_aref_with is an optimized instruction for accessing a Hash using a
non-frozen string key (ie. from a file without frozen_string_literal).
It attempts to avoid allocating the string, and instead silently using a
frozen string (hash string keys are always fstrings).
Because this is just an optimization, it should be invisible to the
user. However, previously this optimization was could be seen via hashes
with default procs.
For example, previously:
h = Hash.new { |h, k| k.frozen? }
str = "foo"
h[str] # false
h["foo"] # true when optimizations enabled
This commit checks that the Hash doesn't have a default proc when using
opt_aref_with.
2022-08-04 14:48:47 -07:00
David Rodríguez
c84d0538be
[rubygems/rubygems] Fix unused variable warning
...
```
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_gem_resolver_installer_set.rb:55: warning: assigned but unused variable - a_1_local
```
9ea4534800
2022-08-05 00:09:18 +09:00
David Rodríguez
542040fb83
[rubygems/rubygems] Warn dangling symlinks
...
425b78637f
2022-08-04 13:36:45 +09:00
Jean Boussier
4406cb1bf1
Harden Queue#pop timeout tests
...
They occasionaly fail with;
```
FLeaked thread: TestThreadQueue#test_queue_pop_timeout: #<Thread:0x0000000108e38e48 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 sleep>
.Finished thread: TestThreadQueue#test_deny_pushers: #<Thread:0x0000000108e38e48 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 dead>
...
Retrying...
1) Failure:
TestThreadQueue#test_sized_queue_pop_timeout [/Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:157]:
<#<Thread:0x00000001084bc7e8 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:156 sleep>> expected but was
<nil>.
2) Failure:
TestThreadQueue#test_queue_pop_timeout [/Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:124]:
<#<Thread:0x00000001083ff058 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 sleep>> expected but was
<nil>.
```
I'm hoping joining for longer should help avoid this.
2022-08-03 10:59:13 +02:00
Hiroshi SHIBATA
71794a75db
Merge rubygems/bundler HEAD
...
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
Ilya Dyakonov
4f00ee8d47
[rubygems/rubygems] fix platform matching for index specs
...
f087f1b590
2022-08-03 06:56:36 +09:00
David Rodríguez
20936eb3a9
[rubygems/rubygems] Warn (rather than crash) when setting nil
specification versions
...
a4ba1a4d97
2022-08-03 06:56:18 +09:00
Jean Boussier
e3aabe93aa
Implement Queue#pop(timeout: sec)
...
[Feature #18774 ]
As well as `SizedQueue#pop(timeout: sec)`
If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-02 11:04:28 +02:00
Nobuyoshi Nakada
ec3f59309e
[Bug #17767 ] Now ENV.clone
raises TypeError
as well as ENV.dup
...
One year ago, the former method has been deprecated while the latter
has become an error. Then the 3.1 released, it is enough time to make
also the former an error.
2022-08-02 16:40:12 +09:00
dependabot[bot]
24204d54ab
[rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
...
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys ) from 0.9.26 to 0.9.28.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases )
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.26...v0.9.28 )
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
edea8fbfa0
2022-08-02 04:14:48 +09:00
dependabot[bot]
25022bad85
[rubygems/rubygems] Bump rb-sys
...
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys ) from 0.9.26 to 0.9.28.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases )
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.26...v0.9.28 )
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
831a001697
2022-08-02 02:37:55 +09:00
Koichi Sasada
5bbba76489
respect current frame of rb_eval_string
...
`self` is nearest Ruby method's `self`.
If there is no ruby frame, use toplevel `self` (`main`).
https://bugs.ruby-lang.org/issues/18780
2022-08-01 17:48:05 +09:00
Akinori MUSHA
1a73a6cdd2
Implement Enumerator::Product and Enumerator.product [Feature #18685 ]
2022-07-30 20:05:14 +09:00
Nobuyoshi Nakada
af265d73fb
[ruby/rdoc] Fix blockquote with word in verbatim
...
75eee668a5
2022-07-30 11:04:11 +09:00
Ethan
b2cc74a50d
[flori/json] test parsing of unicode, mixing literal characters with escaped
...
82fe866da2
2022-07-29 19:10:10 +09:00
konsolebox
419ad1e13e
[ruby/optparse] Also accept '-' as an optional argument ( https://github.com/ruby/optparse/pull/35 )
...
f2b8318631
2022-07-29 19:10:10 +09:00
Nobuyoshi Nakada
f29f1d22c3
[ruby/rdoc] Fix formatting blockquote in verbatim
...
Reported at https://github.com/ruby/rdoc/pull/907#discussion_r932505816
86384ac7f9
2022-07-29 09:21:33 +09:00