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

15359 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Evans f53dfab95c Add support for anonymous rest and keyword rest argument forwarding
This allows for the following syntax:

```ruby
def foo(*)
  bar(*)
end
def baz(**)
  quux(**)
end
```

This is a natural addition after the introduction of anonymous
block forwarding.  Anonymous rest and keyword rest arguments were
already supported in method parameters, this just allows them to
be used as arguments to other methods.  The same advantages of
anonymous block forwarding apply to rest and keyword rest argument
forwarding.

This has some minor changes to #parameters output.  Now, instead
of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`.
These were already used for `...` forwarding, so I think it makes
it more consistent to include them in other cases.  If we want to
use `[:rest], [:keyrest]` in both cases, that is also possible.

I don't think the previous behavior of `[:rest], [:keyrest]` in
the non-... case and `[:rest, :*], [:keyrest, :**]` in the ...
case makes sense, but if we did want that behavior, we'll have to
make more substantial changes, such as using a different ID in the
... forwarding case.

Implements [Feature #18351]
2021-12-30 14:37:42 -08:00
Nobuyoshi Nakada db547a3bc4
[ruby/win32ole] Undefine allocator of WIN32OLE_VARIABLE to get rid of warning
https://github.com/ruby/win32ole/commit/27d0fdc622
2021-12-30 21:13:11 +09:00
aycabta 2a311594cc [ruby/reline] Omit a test on Ruby 2.6
Some tokens in Ruby 2.6 have difference information than in 2.7 and later,
but 2.6 will soon be out of support.

https://github.com/ruby/reline/commit/f3bc698385
2021-12-30 20:52:06 +09:00
aycabta 9295732af8 [ruby/reline] Use ripper_lex_without_warning
https://github.com/ruby/reline/commit/b7536dc224
2021-12-30 20:52:06 +09:00
ima1zumi f589242e75 [ruby/reline] Use unix_line_discard when Ctrl-u is entered
The kill-line was called when C-u was entered, so it is now called unix-line-discard.

In readline(3):

> unix-line-discard (C-u)
>               Kill backward from point to the beginning of the line.
>               The killed text is saved on the kill-ring.

https://github.com/ruby/reline/commit/27570d195e
2021-12-30 20:23:58 +09:00
Hiroshi SHIBATA 239e71c0af [ruby/reline] Use omit instead of skip
https://github.com/ruby/reline/commit/a538de421f
2021-12-29 20:12:36 +09:00
Hiroshi SHIBATA f25c2e6336
Use omit instead of skip: test/ruby/enc/**/*.rb 2021-12-29 19:27:58 +09:00
Samuel Williams f27eb8148f
Sync io-console gem. 2021-12-29 13:27:40 +13:00
Hiroshi SHIBATA 763592d208
Use omit instead of skip: test/-ext-/**/*.rb 2021-12-28 21:13:39 +09:00
Hiroshi SHIBATA 55cdb8b013
Use omit instead of skip: test/socket/**/*.rb 2021-12-28 20:29:54 +09:00
Nobuyoshi Nakada bf97415c02 Removed deprecated Dir.exists? and File.exists? 2021-12-28 18:36:30 +09:00
Takashi Kokubun eb49aa3119
Fix test_rubyoptions for MinGW (#5363)
* Fix test_rubyoptions for MinGW

follows up a74a2f456a

* Require jit_support

* Fix MinGW platform

* Handle MinGW UCRT

and fix the prefix

* Make it more robust
2021-12-27 22:22:09 -08:00
David Rodríguez be476f38f9 [rubygems/rubygems] Don't crash when updating to an unsupported `rubygems-update` version
https://github.com/rubygems/rubygems/commit/b0badcd00a
2021-12-27 22:57:46 +09:00
U.Nakamura a74a2f456a Now YJIT can be enabled on mswin64 2021-12-27 17:29:16 +09:00
Nobuyoshi Nakada c956f979e5
Initialize Struct by calling with keyword arguments 2021-12-26 23:28:54 +09:00
Nobuyoshi Nakada 69f03c864e
Remove Refinement#include and Refinement#prepend 2021-12-26 23:28:54 +09:00
Nobuyoshi Nakada 39bc5de833
Remove tainted and trusted features
Already these had been announced to be removed in 3.2.
2021-12-26 23:28:54 +09:00
Yusuke Endoh 0dc7816c43 Make RubyVM::AST.of work with code written in `-e` command-line option
[Bug #18434]
2021-12-26 20:57:34 +09:00
Nobuyoshi Nakada 0867b638af Raise proper exception when month argument is not a name
https://bugs.ruby-lang.org/issues/17485#change-89871
2021-12-25 18:03:50 +09:00
Yusuke Nakamura 44bfe72892 [ruby/openssl] Add tast cases to OpenSSL::BN using ractor
OpenSSL::BN has been make ractor-safed in 9e7cf9e ,
but there was no test.
And to use 'ractor' annotation, update test-unit to v3.4.6 or higher.

https://github.com/ruby/openssl/commit/7541a66911
2021-12-25 03:31:59 +09:00
aycabta c815c0be46 [ruby/reline] Escape newline(s) in dynamic prompt
https://github.com/ruby/reline/commit/9b209ee1ea
2021-12-25 00:32:58 +09:00
aycabta b0db420b0e [ruby/reline] Escape newline(s) in prompt
https://github.com/ruby/reline/commit/b545459fca
2021-12-25 00:32:57 +09:00
aycabta 20dae14ba9 Increase wait time 2021-12-25 00:20:53 +09:00
aycabta a88169bbe9 Wait for output results to test correctly 2021-12-25 00:20:53 +09:00
Yuki Nishijima 03c54a09ec Revert "Revert "Replace an deprecated constant with a new one in did_you_mean""
This reverts commit 1527f7569b.
2021-12-24 23:21:55 +09:00
Yuki Nishijima f9712b029b Sync did_you_mean 2021-12-24 23:20:30 +09:00
aycabta 0aca70e559 Output log after loading class to test 2021-12-24 22:29:06 +09:00
aycabta 0fbf1f193a Add logging about timeout 2021-12-24 20:55:59 +09:00
aycabta 5138ef3875 Kill process before assertion fails 2021-12-24 20:44:02 +09:00
aycabta bad1e153d4 [ruby/reline] Implement em_kill_line
https://github.com/ruby/reline/commit/9fca6ceb45
2021-12-24 18:23:28 +09:00
aycabta 6c3cc9c58a [ruby/reline] Rename the wrong name "em-kill-line" with the correct name "unix-line-discard"
https://github.com/ruby/reline/commit/da7af35d1f
2021-12-24 18:23:28 +09:00
aycabta 9de42d3b34 [ruby/reline] Bind ed-kill-line to C-u on emacs mode
https://github.com/ruby/reline/commit/9ab99574f5
2021-12-24 18:23:28 +09:00
Nobuyoshi Nakada 517964d57b
Move embedded lines outside the here document
So that the actually run test code corresponds to the source file
line-by-line.
2021-12-24 17:33:45 +09:00
aycabta f8a0ef30b2 Set time limit for waiting for terminating process within a test 2021-12-24 17:12:01 +09:00
Yusuke Endoh 424800f707 [ruby/reline] Fix test input_keys to handle "hankaku" characters correctly on Windows
The method "input_keys" in test/reline/helper.rb handles a single-byte
and 8-bit charater as an input with the meta key.
However, "test_halfwidth_kana_width_dakuten" in test/reline/test_key_actor_emacs.rb
uses a string that contains "hankaku" characters.
A "hankaku" character is not with the meta key, but it is a single-byte
and 8-bit character on Windows-31J encoding, which confused "input_keys"
method. This caused the following error.

https://ci.appveyor.com/project/ruby/ruby/builds/41997092/job/ejm77qxgvnlpdwvg
```
  1) Failure:
Reline::KeyActor::Emacs::Test#test_halfwidth_kana_width_dakuten [C:/projects/ruby/test/reline/test_key_actor_emacs.rb:2311]:
<"\xB6\xDE\xB7\xDE\xB9\xDE\xBA\xDE" (#<Encoding:Windows-31J>)> expected but was
<"\e^\e^\e^\e:\e^" (#<Encoding:Windows-31J>)> in <Terminal #<Encoding:Windows-31J>>
.
<8> expected but was
<10>.
Finished tests in 1045.472722s, 19.3922 tests/s, 2609.4320 assertions/s.
```

This change introduces "input_raw_keys" that does not convert a
single-byte and 8-bit character to "with the meta key", and use it in
the test in question.

https://github.com/ruby/reline/commit/f6ae0e5d19
2021-12-24 15:01:17 +09:00
Sutou Kouhei 1a1550ba5d [ruby/csv] test: reduce size for stability on GitHub Actions
https://github.com/ruby/csv/commit/68461aead5
2021-12-24 14:35:33 +09:00
Sutou Kouhei 22ef4f6445 [ruby/csv] Revert "parser: fix a keep bug that some texts may be dropped unexpectedly"
This reverts commit https://github.com/ruby/csv/commit/5c6523da0a61.

This introduces another pbolem. We should try again later.

https://github.com/ruby/csv/commit/43a1d6fff1
2021-12-24 14:35:33 +09:00
Sutou Kouhei 4a5d372ca8 [ruby/csv] parser: fix a keep bug that some texts may be dropped unexpectedly
Ruby: [Bug #18245] [ruby-core:105587]

Reported by Hassan Abdul Rehman.

https://github.com/ruby/csv/commit/5c6523da0a
2021-12-24 14:35:33 +09:00
adamroyjones c70dc3cafb [ruby/csv] Add handling for ambiguous parsing options (https://github.com/ruby/csv/pull/226)
GitHub: fix GH-225

With Ruby 3.0.2 and csv 3.2.1, the file

```ruby
require "csv"
File.open("example.tsv", "w") { |f| f.puts("foo\t\tbar") }
CSV.read("example.tsv", col_sep: "\t", strip: true)
```

produces the error

```
lib/csv/parser.rb:935:in `parse_quotable_robust': TODO: Meaningful
message in line 1. (CSV::MalformedCSVError)
```

However, the CSV in this example is not malformed; instead, ambiguous
options were provided to the parser. It is not obvious (to me) whether
the string should be parsed as

- `["foo\t\tbar"]`,
- `["foo", "bar"]`,
- `["foo", "", "bar"]`, or
- `["foo", nil, "bar"]`.

This commit adds code that raises an exception when this situation is
encountered. Specifically, it checks if the column separator either ends
with or starts with the characters that would be stripped away.

This commit also adds unit tests and updates the documentation.

https://github.com/ruby/csv/commit/cc317dd42d
2021-12-24 14:35:33 +09:00
Nobuyoshi Nakada 47c53af168 [ruby/csv] Fix typos [ci skip] (https://github.com/ruby/csv/pull/224)
https://github.com/ruby/csv/commit/27c0b66c8f
2021-12-24 14:35:33 +09:00
aycabta ae770cc372 [ruby/reline] Add encoding info to an assertion of editing line
https://github.com/ruby/reline/commit/22d9262d79
2021-12-24 11:03:34 +09:00
Hiroshi SHIBATA b0ad6cb371 Merge RubyGems-3.3.2 and Bundler-2.3.2 2021-12-24 10:35:31 +09:00
Kenta Murata a1d9fbef05
[ruby/bigdecimal] Fix the result precision of BigDecimal#divmod
https://github.com/ruby/bigdecimal/commit/a32f6cb9e2
2021-12-24 02:29:01 +09:00
Kenta Murata 79712fc083
[ruby/bigdecimal] Let BigDecimal#quo accept precision
Fix GH-214.

https://github.com/ruby/bigdecimal/commit/13e0e93f37
2021-12-24 02:29:00 +09:00
Kenta Murata 98918209b7
[ruby/bigdecimal] Allow passing both float and precision in BigDecimal#div
Fix GH-212.

https://github.com/ruby/bigdecimal/commit/900bb7fcf5
2021-12-24 02:29:00 +09:00
Kenta Murata 84ae7a5df9
[ruby/bigdecimal] Add BigDecimal#precision_scale
https://github.com/ruby/bigdecimal/commit/c019caeaba
2021-12-24 02:28:59 +09:00
Kenta Murata aca96f7ec7
[ruby/bigdecimal] Add BigDecimal#scale
Fixes GH-198.

https://github.com/ruby/bigdecimal/commit/4fbec55680
2021-12-24 02:28:58 +09:00
Kenta Murata d905abb457
[ruby/bigdecimal] Fix BigDecimal#precision for single DECDIG case
Fix GH-205

https://github.com/ruby/bigdecimal/commit/7d198394a2
2021-12-24 02:28:56 +09:00
Kenta Murata 75f552e973
[ruby/bigdecimal] Fix the precision of the adjusted quotient
https://github.com/ruby/bigdecimal/commit/8dc8cd339d
2021-12-24 02:28:56 +09:00
Kenta Murata 7b2cfce543
[ruby/bigdecimal] Let BigDecimal_DoDivmod use the same precision calculation as BigDecimal_divide
https://github.com/ruby/bigdecimal/commit/11cb2c8840
2021-12-24 02:28:55 +09:00