Commit graph

16449 commits

Author SHA1 Message Date
Hiroshi SHIBATA
e442ec4ea0
[ruby/logger] Removed loading old helper file and load Logger class by itself
5ee0fd6e51
2021-12-18 08:38:58 +09:00
Baron Bloomer
4375546810
[ruby/logger] Test cases
40adb645e2
2021-12-18 08:38:58 +09:00
John Hawthorn
83aa68447c YJIT: Allow iseq with both opt and kwargs
Previously we mirrored the fast paths the interpreter had for having
only one of kwargs or optional args. This commit aims to combine the
cases and reduce complexity.

Though this allows calling iseqs which have have both optional and
keyword arguments, it requires that all optional arguments are specified
when there are keyword arguments, since unspecified optional arguments
appear before the kwargs. Support for this can be added a in a future
PR.
2021-12-17 15:26:04 -08:00
Koichi Sasada
37bd795cf8 ENV ivars should not be accessible from ractors
The `ENV` object can have instance variables like other objects,
but they should be accessed only on the main ractor.

fix https://github.com/ruby/ruby/pull/5263#issuecomment-995585766
2021-12-17 15:46:50 +09:00
Nobuyoshi Nakada
2585ff30d7
Send the message for s390x to stderr [ci skip]
Parallel worker's stdout is captured as the control protocol.
2021-12-17 11:28:06 +09:00
Nobuyoshi Nakada
69a7eaae38
Use to_s and puts in tests
`to_s` has the explict specification while `inspect` is often
vague.
2021-12-16 15:12:12 +09:00
Hiroshi SHIBATA
1694190833
Skip test_operating_system_customizing_default_dir for failing with rubyci 2021-12-15 21:32:32 +09:00
David Rodríguez
9f87c0cc6d [rubygems/rubygems] Pass :bimode explicitly to File.open
The `File::BINARY` flag is apparently ignored due to a ruby bug, and
thus writing can cause encoding issues.

db4efbebf2
2021-12-15 19:46:44 +09:00
David Rodríguez
c2dbdf3067 [rubygems/rubygems] Extract a helper to temporarily modify internal encoding
93051fd2aa
2021-12-15 19:46:43 +09:00
David Rodríguez
890a6b432c [rubygems/rubygems] Unify duplicated helper
c6ef75424d
2021-12-15 19:46:43 +09:00
Hiroshi SHIBATA
5044371621 Skip s390x because Travis CI was failing with unknown reason 2021-12-15 18:05:18 +09:00
Hiroshi SHIBATA
7e084ed707 Merge RubyGems and Bundler master
Merge from 793ad95ecb
2021-12-15 18:05:18 +09:00
Koichi Sasada
13c37835d5 ucrt can raise Errno::EINVAL
`ENV[key] = long_str` can raise `Errno::EINVAL` also on ucrt env.
2021-12-15 15:04:34 +09:00
Koichi Sasada
04aab3c259 fix test 2021-12-15 15:04:34 +09:00
Nobuyoshi Nakada
9bb83a82ab Removed traling spaces [ci skip] 2021-12-15 15:04:34 +09:00
Rohit Menon
e071ac8b3d Add Ractor tests for ENV 2021-12-15 15:04:34 +09:00
Nobuyoshi Nakada
aa7c4c37d7 Fix arg_forward without parentheses [Bug #18267] 2021-12-15 07:01:20 +09:00
Nobuyoshi Nakada
6daec46014 ripper: refine test to show expected states 2021-12-14 20:06:51 +09:00
Takashi Kokubun
1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Nobuyoshi Nakada
900e0c8c39 [ruby/securerandom] Use String#unpack1
5460a18c35
2021-12-14 11:59:22 +09:00
Takashi Kokubun
11b8aaa26a
Rename --jit to --mjit (#5248)
* Rename --jit to --mjit

[Feature #18349]

* Fix a few more --jit references

* Fix MJIT Actions

* More s/jit/mjit/ and re-introduce --disable-jit

* Update NEWS.md

* Fix test_bug_reporter_add
2021-12-13 16:08:01 -08:00
aycabta
8411e8449b [ruby/reline] Remove unnecessary variables, lower_space
The number of lines below the cursor position was known by
"@rest_height" alone, but the problem was caused by adding
"lower_space". Remove "lower_space" as it is unnecessary.

a575cef6a3
2021-12-13 20:44:21 +09:00
Koichi Sasada
5164c2b36f Pass UnboundMethod to 2nd arg of define_method 2021-12-13 10:23:52 +09:00
Koichi Sasada
fdfb43b2b1 fix Struct's setter arity
https://github.com/ruby/ruby/pull/5131/files#diff-b2553d23e6b1fe76e20608d06c25f6acca06279100f1a9c24febcd79a82fac3cR2689
2021-12-13 10:23:52 +09:00
Koichi Sasada
6659253cc6 Struct setter's parameters == [:req, :_]
fix [Bug #18405]

Note that the parameter name `_` is not a spec, so we shouldn't
rely on this behavior.
2021-12-13 10:23:52 +09:00
Nobuyoshi Nakada
e4b35b158a [ruby/cgi] Check integer overflow in long range
https://hackerone.com/reports/1328463

ccaf6027e0
2021-12-12 13:05:15 +09:00
ima1zumi
5f1975a454 [ruby/reline] @convert_meta is true unless 8-bit characters
If Reline::IOGate.encoding contains 7-bit characters, convert-meta will set it On.

Because in readline(3):

>  The default is On, but readline will set it to Off if the locale contains eight-bit characters.

As far as I know, 7-bit encoding used in terminals is only US-ASCII.

b71d1fa496
2021-12-10 22:19:14 +09:00
ima1zumi
519a945efc [ruby/reline] Execute compress_meta_key if convert_meta is on
fix `#357`

When using 8-bit characters, it is better not to use `compress_meta_key`.
I believe not to use `compress_meta_key` unless `set convert-meta on` is written in the `.inputrc`.

The following is a quote from tmtm's comments.

> The behavior of this compress_meta_key method is similar to the behavior of convert-meta=on in readline, but readline turns off convert-meta if the locale contains 8bit characters.

> In readline(3):

> convert-meta (On)
> If set to On, readline will convert characters with the eighth
> bit set to an ASCII key sequence by stripping the eighth bit and
> prefixing it with an escape character (in effect, using escape
> as the meta prefix). The default is On, but readline will set
> it to Off if the locale contains eight-bit characters.

9491cc8542

Co-authored-by: TOMITA Masahiro <tommy@tmtm.org>
2021-12-10 22:19:14 +09:00
Kevin Logan
eb2d3c19fe [rubygems/rubygems] Properly fetch Gem#latest_spec_for with multiple sources
a93ec63df3
2021-12-10 20:54:29 +09:00
Jeremy Evans
2727815068 Add {Method,UnboundMethod}#{public?,private?,protected?}
These methods allow for checking whether the method has that
visibility.

Implements [Feature #11689]
2021-12-09 12:59:37 -08:00
Koichi Sasada
9873af0b1a TracePoint.allow_reentry
In general, while TracePoint callback is running,
other registerred callbacks are not called to avoid
confusion by reentrace.
This method allow the reentrace. This method should be
used carefully, otherwize the callback can be easily called
infinitely.

[Feature #15912]

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2021-12-10 00:56:25 +09:00
Nobuyoshi Nakada
da652e1827
Check month overflow when marshal
https://hackerone.com/reports/1244185
2021-12-09 21:51:39 +09:00
Nobuyoshi Nakada
12a0a89e22 [ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]
1e57277b9e
2021-12-09 20:26:44 +09:00
Charles Oliver Nutter
080169147e
[ruby/open3] Use RbConfig's 'host_os'
RUBY_PLATFORM on JRuby is always 'java' so it does not indicate
the host OS.

d2308040e6
2021-12-09 19:28:54 +09:00
Charles Oliver Nutter
34ebd13923
[ruby/open3] Only use JITSupport on CRuby
Fixes #2

6b7ede69e8
2021-12-09 19:28:54 +09:00
aycabta
6ff9fcdfa8 [ruby/rdoc] Support addition Object class when adding methods to top level
23747b4950
2021-12-09 18:16:06 +09:00
aycabta
2e50989ad3 [ruby/rdoc] Resolve class and method of the same name correctly
1e16284fe5
2021-12-09 18:16:05 +09:00
Koichi Sasada
cce331272b Ractor.make_shareable checks proc's sefl
`Ractor.make_shareable(proc_obj)` raises an `IsolationError`
if the self of `proc_obj` is not a shareable object.

[Bug #18243]
2021-12-09 16:20:04 +09:00
David Rodríguez
45c5794d32 [rubygems/rubygems] Don't load system rubygems during tests
Since tests are about testing our development copy of rubygems, not
whatever is installed in the system.

f5e0b68cdd
2021-12-09 08:58:25 +09:00
Nobuyoshi Nakada
d6c5a30cfd ObjectSpace::WeakMap#inspect: check if living object [Bug #18392] 2021-12-07 21:55:41 +09:00
Marc-André Lafortune
95d9bcf2b2 [ruby/ostruct] Alias less methods
Skips methods that do not end with letter (in particular `!~` and `=~`)
For JRuby, also skip `instance_exec`, `instance_eval` and `eval`
2021-12-06 23:21:07 -05:00
David Rodríguez
d044ffd77f [rubygems/rubygems] Allow using Gem::Version without loading the rest of rubygems
1b862537a5
2021-12-06 18:43:29 +09:00
David Rodríguez
e41c195cc5 [rubygems/rubygems] Fix incorrect quoting
Test was just returning a string instead of actually exercising the
require.

62c827d7e1
2021-12-06 18:43:28 +09:00
Colby Swandale
9c0c66f721 [rubygems/rubygems] add login & logout for the signin & signout commands respectively
49b491970b
2021-12-06 17:42:56 +09:00
David Rodríguez
e713552868 [rubygems/rubygems] LOAD_PATH is already reset globally
b0bbb27115
2021-12-06 05:25:22 +09:00
David Rodríguez
2fc47bad78 [rubygems/rubygems] Remove unneded setup
9815a04e31
2021-12-06 05:25:21 +09:00
Nobuyoshi Nakada
bbfefd45c6
[ruby/securerandom] Remove no longer used helper methods
Unused since r59801, 782b2050b8,
or 52c8e7a85e.

38fc2c4427
2021-12-05 23:13:23 +09:00
Nobuyoshi Nakada
b555e659c4
Do not use fcopyfile if appending to non-empty file [Bug #18388]
`fcopyfile` appends `src` to `to` and then truncates `to` to it's
original size.
2021-12-05 18:47:02 +09:00
David Rodríguez
a72aecac3a [rubygems/rubygems] Don't write outside of destdir when regenerating plugins
141ef4cb9a
2021-12-05 05:47:46 +09:00
David Rodríguez
9dc76e102e [rubygems/rubygems] Don't write outside of destdir when installing default bundler
a62d00c5e8
2021-12-05 05:47:45 +09:00