Граф коммитов

15297 Коммитов

Автор SHA1 Сообщение Дата
Yuki Nishijima 573d9d3a4a Replace an deprecated constant with a new one in did_you_mean 2021-12-22 21:21:27 +09:00
Yuki Nishijima ac4e0978ee * gems/default_gems: Sync did_you_mean 2021-12-22 20:29:18 +09:00
Nobuyoshi Nakada fdf3996349
Empty and return the buffer if zero size is given [Bug #18421]
In `IO#readpartial` and `IO#read_nonblock`, as well as `IO#read`.
2021-12-22 15:45:59 +09:00
Samuel Williams e30920354f
Extended interface for IO::Buffer & documentation. 2021-12-22 10:57:34 +13:00
Yuki Nishijima cdb7d699d0 Revert commits for did_you_mean
This reverts commit 4560091b1c.
This reverts commit a6f76122a2.
This reverts commit e59b18a637.
This reverts commit 505dfae05d.
2021-12-21 22:10:03 +09:00
Yuki Nishijima a6f76122a2 * gems/default_gems: Fix CI builds 2021-12-21 20:03:47 +09:00
Yuki Nishijima 505dfae05d * gems/default_gems: Sync did_you_mean 2021-12-21 19:03:25 +09:00
aycabta 1855f901c8 [ruby/irb] Check colorize option correctly to clear char attr and don't use it for tests
https://github.com/ruby/irb/commit/de561cafeb
2021-12-21 15:50:32 +09:00
Koichi Sasada df48db987d `mandatory_only_cme` should not be in `def`
`def` (`rb_method_definition_t`) is shared by multiple callable
method entries (cme, `rb_callable_method_entry_t`).

There are two issues:

* old -> young reference: `cme1->def->mandatory_only_cme = monly_cme`
  if `cme1` is young and `monly_cme` is young, there is no problem.
  Howevr, another old `cme2` can refer `def`, in this case, old `cme2`
  points young `monly_cme` and it violates gengc assumption.
* cme can have different `defined_class` but `monly_cme` only has
  one `defined_class`. It does not make sense and `monly_cme`
  should be created for a cme (not `def`).

To solve these issues, this patch allocates `monly_cme` per `cme`.
`cme` does not have another room to store a pointer to the `monly_cme`,
so this patch introduces `overloaded_cme_table`, which is weak key map
`[cme] -> [monly_cme]`.

`def::body::iseqptr::monly_cme` is deleted.

The first issue is reported by Alan Wu.
2021-12-21 11:03:09 +09:00
Samuel Williams 617687df09 Rename IMMUTABLE to READONLY. 2021-12-21 12:25:42 +13:00
Samuel Williams 9fbf94ff04 Improve interface for get/set/copy. 2021-12-21 12:25:42 +13:00
Samuel Williams c86bcd434d Mark non-private mapped files as external. 2021-12-21 12:25:42 +13:00
Samuel Williams da46b8d8e5 Default `IO::Buffer#get_string` to use BINARY encoding. 2021-12-21 12:25:42 +13:00
Samuel Williams c3d8d26ad7 Add tests for `IO::Buffer` `get`/`set`. 2021-12-21 12:25:42 +13:00
Samuel Williams 71bbc40ffa Rename `to_str` -> `get_string` and add support for encodings. 2021-12-21 12:25:42 +13:00
Samuel Williams 49166fc74a Improved exception usage/classes. 2021-12-21 12:25:42 +13:00
Samuel Williams 71bf5cef75 Fix handling of frozens strings. 2021-12-21 12:25:42 +13:00
Samuel Williams 9de5c4ec76 Fix mapping invalid non-file object. 2021-12-21 12:25:42 +13:00
Brandon Fish 8b1b4e384f [rubygems/rubygems] Skip find_in_unresolved_tree test for TruffleRuby due to longer runtime
https://github.com/rubygems/rubygems/commit/36b8fbc508
2021-12-21 04:57:23 +09:00
Jeremy Evans 3bd5f27f73 Remove Class#descendants 2021-12-20 11:02:15 -08:00
Kazuki Yamaguchi 6b67f06312 test/fiber/test_io_buffer.rb: fix file descriptor leaks
I got the warning while running "make test-all":

	Leaked file descriptor: TestFiberIOBuffer#test_write_nonblock: 9 : #<UNIXSocket:fd 9>
	Closed file descriptor: TestFiberIOBuffer#test_read_write_blocking: 9
	Leaked file descriptor: TestFiberIOBuffer#test_timeout_after: 10 : #<UNIXSocket:fd 10>
	Closed file descriptor: TestFiberIOBuffer#test_read_nonblock: 10
2021-12-21 00:05:24 +09:00
Kazuki Yamaguchi 2df917ed4f [ruby/openssl] ssl: update test_options_disable_versions
Use the combination of TLS 1.2 and TLS 1.3 instead of TLS 1.1 and TLS
1.2 so that will the test case will be run on latest platforms.

https://github.com/ruby/openssl/commit/e168df0f35
2021-12-20 23:42:04 +09:00
Kazuki Yamaguchi 15eefd30ad [ruby/openssl] ssl: update test_accept_errors_include_peeraddr test case
Use a different invalid data example to prevent SSLSocket#accept from
reaching EOF.

https://github.com/ruby/openssl/commit/2e089c1916
2021-12-20 23:42:03 +09:00
Kazuki Yamaguchi 79a6f4349d [ruby/openssl] hmac: skip test_dup on OpenSSL 3.0 for now
EVP_MD_CTX_copy() doesn't seem to work as intended on HMAC EVP_MD_CTX
on OpenSSL 3.0.0 and causes a double free. I haven't found the root
problem yet, but let's skip the test case for now.

https://github.com/ruby/openssl/commit/4699581639
2021-12-20 23:42:03 +09:00
Kazuki Yamaguchi cfcdd2b4bd [ruby/openssl] cipher: update test_ciphers
Do not attempt to actually use all algorithms. Not all algorithms listed
in OpenSSL::Cipher.ciphers are always available.

https://github.com/ruby/openssl/commit/91d04f991f
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi 8ebf597885 [ruby/openssl] pkey: deprecate PKey#set_* methods
OpenSSL 3.0 made EVP_PKEY immutable. This means we can only have a const
pointer of the low level struct and the following methods can no longer
be provided when linked against OpenSSL 3.0:

 - OpenSSL::PKey::RSA#set_key
 - OpenSSL::PKey::RSA#set_factors
 - OpenSSL::PKey::RSA#set_crt_params
 - OpenSSL::PKey::DSA#set_pqg
 - OpenSSL::PKey::DSA#set_key
 - OpenSSL::PKey::DH#set_pqg
 - OpenSSL::PKey::DH#set_key
 - OpenSSL::PKey::EC#group=
 - OpenSSL::PKey::EC#private_key=
 - OpenSSL::PKey::EC#public_key=

There is no direct replacement for this functionality at the moment.
I plan to introduce a wrapper around EVP_PKEY_fromdata(), which takes
all key components at once to construct an EVP_PKEY.

https://github.com/ruby/openssl/commit/6848d2d969
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi b93ae54258 [ruby/openssl] pkey/ec: deprecate OpenSSL::PKey::EC#generate_key!
OpenSSL::PKey::EC#generate_key! will not work on OpenSSL 3.0 because
keys are made immutable. Users should use OpenSSL::PKey.generate_key
instead.

https://github.com/ruby/openssl/commit/5e2e66cce8
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi 0d698be04f [ruby/openssl] pkey/dh: deprecate OpenSSL::PKey::DH#generate_key!
OpenSSL::PKey::DH#generate_key! will not work on OpenSSL 3.0 because
keys are made immutable. Users should use OpenSSL::PKey.generate_key
instead.

https://github.com/ruby/openssl/commit/8ee6a582c7
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi 582606dc58 [ruby/openssl] pkey: test parsing concatenated PEM string
PEM-encoded private keys are sometimes stored together with irrelevant
PEM blocks, such as the corresponding X.509 certificate.

PEM_read_bio_*() family automatically skips unknown PEM blocks, but on
OpenSSL 3.0 we will be using the new OSSL_DECODER API instead due to
some breaking changes around the password callback.

Let's add a test case so that we won't break the current behavior.

https://github.com/ruby/openssl/commit/8c185e0ae5
2021-12-20 23:42:00 +09:00
Yusuke Endoh 1c72c95d99 test/ruby/test_ast.rb: Avoid a "method redefined" warning 2021-12-20 19:45:25 +09:00
aycabta 7b0f2d618e [ruby/irb] Remove unnecessary space in regexp
https://github.com/ruby/irb/commit/c24a8e2483
2021-12-20 16:19:37 +09:00
aycabta b96ef7684c [ruby/irb] Add East Asian Ambiguous Width to irb_info command
https://github.com/ruby/irb/commit/4cade4b7e5
2021-12-20 16:19:36 +09:00
aycabta 7572e0c6ec [ruby/reline] Add a test for dialog proc with context
https://github.com/ruby/reline/commit/2ce2696d6e
2021-12-20 14:54:45 +09:00
aycabta bb12281164 [ruby/reline] Add an assertion for overwriting dialog proc with the same name
https://github.com/ruby/reline/commit/96067bc13c
2021-12-20 14:54:44 +09:00
aycabta cc072899a1 [ruby/reline] Rename the variable "p" because it overlaps with the "p" method
https://github.com/ruby/reline/commit/9bf2ca692e
2021-12-20 14:54:43 +09:00
aycabta 145c1e0691 [ruby/reline] Add support for overwriting dialog proc with the same name
https://github.com/ruby/reline/commit/16aa20c380
2021-12-20 14:54:42 +09:00
aycabta c462e07a5c [ruby/reline] Add Reline.dialog_proc(name_sym)
https://github.com/ruby/reline/commit/7e5dbe4750
2021-12-20 14:54:42 +09:00
aycabta ec517d60b0 [ruby/reline] Add a test for Reline.add_dialog_proc
https://github.com/ruby/reline/commit/c4bb1bfd79
2021-12-20 14:54:41 +09:00
Samuel Williams 56811617ab Improve IO::Buffer resize and introduce ownership transfer. 2021-12-20 00:17:17 +13:00
aycabta 7159af3491 [ruby/reline] Clear dialog in pasting
https://github.com/ruby/reline/commit/dabf5313e0
2021-12-19 11:19:50 +09:00
Samuel Williams f3e30b26c5 Default size for IO::Buffer. 2021-12-19 12:25:38 +13:00
Daniel Colson 45f2182438 YJIT: Implement intern
`intern` showed up in the top 20 most frequent exit ops (granted with a
fairly small percentage) in a benchmark run by @jhawthorn on
github/github.

This implementation is similar to gen_anytostring, but with 1
stack pop instead of 2.

Co-authored-by: John Hawthorn <jhawthorn@github.com>
2021-12-18 15:59:30 -05:00
Yusuke Endoh 6a51c3e80c Make AST.of possible even under eval when keep_script_lines is enabled
Now the following code works without an exception.

```
RubyVM.keep_script_lines = true

eval(<<END)
def foo
end
END

p RubyVM::AbstractSyntaxTree.of(method(:foo))
```
2021-12-19 04:00:51 +09:00
Yusuke Endoh acac2b8128 Make RubyVM::AbstractSyntaxTree.of raise for backtrace location in eval
This check is needed to fix a bug of error_highlight when NameError
occurred in eval'ed code.
https://github.com/ruby/error_highlight/pull/16

The same check for proc/method has been already introduced since
64ac984129.
2021-12-19 03:51:37 +09:00
Samuel Williams 42d3231154
Introduce io_result wrapper for passing `[-errno, size]` in VALUE. 2021-12-18 18:19:30 +13:00
aycabta adf6c0928d [ruby/reline] Change a test method name to more appropriate
https://github.com/ruby/reline/commit/d014cc85b7
2021-12-18 10:15:23 +09:00
Charles Oliver Nutter 66ec3217df
[ruby/pp] Add context to bind_call and skip 2.7+ test
The bind_call definition here is added primarily to support
running the tests on JRuby 9.3, which only supports Ruby 2.6
features. The excluded test appears to depend on inspect behavior
that changed after Ruby 2.6.

With these two changes the test suite runs green on Ruby 2.6 and
JRuby 9.3.

https://github.com/ruby/pp/commit/892c612958
2021-12-18 08:38:59 +09:00
Charles Oliver Nutter cc73dfb92a
[ruby/pp] Incorporate 2.6 versions of 2.7 methods needed
* UnboundMethod#bind_call
* ruby2_keywords gem for testing

https://github.com/ruby/pp/commit/721d8cbd10
2021-12-18 08:38:59 +09:00
Hiroshi SHIBATA e442ec4ea0
[ruby/logger] Removed loading old helper file and load Logger class by itself
https://github.com/ruby/logger/commit/5ee0fd6e51
2021-12-18 08:38:58 +09:00
Baron Bloomer 4375546810
[ruby/logger] Test cases
https://github.com/ruby/logger/commit/40adb645e2
2021-12-18 08:38:58 +09:00