Commit graph

67695 commits

Author SHA1 Message Date
Samuel Williams
5e75280c8e Add basic test for updated IO wait functions. 2021-06-29 23:54:41 +12:00
Yusuke Endoh
39f99b8176 Use assert_not_match "Did you mean?" for UncorrectableNameCheckTest
... instead of exact matching. I'm now creating a built-in gem that
modifies Exception's error message, so the expectation value is changed.

IMO, it is good to check that did_you_mean suggestion is NOT added in
the uncorrectable case.

ebe88ec4d2
2021-06-29 15:49:51 +09:00
Yusuke Endoh
809f120374 Use String#include? instead of end_with? to avoid message duplication
Previously, did_you_mean used `msg.end_with?(suggestion)` to check if
its suggestion is already added.

I'm now creating a gem that also modifies Exception's message. This
breaks did_you_mean's duplication check.
This change makes the check use String#include? instead of end_with?.

b35e030549
2021-06-29 15:49:51 +09:00
Yusuke Endoh
612b6fcd37 Let Correctable#original_message skip prepended method definitions
Previously, DidYouMean::Correctable#original_message did
`method(:to_s).super_method.call` to call the original to_s method by
skipping Correctable#to_s.

I'm now creating a gem that prepends another to_s method to NameError,
which confuses the hack. An immediate solution is to replace it with
`method(:to_s).super_method.super_method.call` to skip the two methods.
But it is too ad-hoc.

This changeset uses more extensible approach and allow a prepended
module to declare that they should be skipped by defining a constant
named `SKIP_TO_S_FOR_SUPER_LOOKUP`.

8352c154e3
2021-06-29 15:49:51 +09:00
Nobuyoshi Nakada
4670458af8 Should require "rbconfig" to use RbConfig
fbe5aaaae8
2021-06-29 15:49:51 +09:00
Yuki Nishijima
8356d9e374 Start v1.6.0 development
3f69171813
2021-06-29 15:49:51 +09:00
Nobuyoshi Nakada
9eae8cdefb
Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
git
983c9ad3f1 * 2021-06-29 [ci skip] 2021-06-29 06:06:50 +09:00
xtkoba
d795f494a8 Avoid free(3)ing invalid pointer
Fixes [Bug #17794]
2021-06-28 14:06:28 -07:00
Nobuyoshi Nakada
b7d01b0d1b
Refined define_thread_class
Reduce duplications
* ID caluculations of the same name
* checks against the same name
* registration to the root module hash
2021-06-28 16:52:49 +09:00
git
ac8c674a81 * 2021-06-28 [ci skip] 2021-06-28 12:10:24 +09:00
Nobuyoshi Nakada
47a9b58b2a
Share freeze option handling 2021-06-28 10:53:37 +09:00
Nobuyoshi Nakada
e724857f42
Show leaked file descriptors only, without cwd, txt, and so on 2021-06-27 21:17:58 +09:00
Nobuyoshi Nakada
3839a8fe79
Narrow the tracing of object allocations to during each test 2021-06-27 21:13:51 +09:00
Nobuyoshi Nakada
13939d61b4
Check if closed after each yield [Bug #17661] 2021-06-27 11:18:41 +09:00
Takashi Kokubun
35c7e83bb3 [ruby/irb] Optimize show_source command further
https://github.com/ruby/irb/pull/249 actually slowed down how `code` is
concatenated. The original way of creating `code` is faster.

[before]
    user     system      total        real
2.420137   0.005364   2.425501 (  2.426264)

[after]
    user     system      total        real
1.000221   0.007454   1.007675 (  1.008295)

Theoretically, this implementation might skip lines that don't appear in
Ripper tokens, but this assumes such lines don't impact whether the code
passes compilation or not. At least normal blank lines seem to have an
`on_ignored_nl` token anyway though.

27dd2867cd
2021-06-27 10:52:49 +09:00
Masataka Pocke Kuwabara
6eb7c663c6 [ruby/irb] Improve performance of show_source for large class
2b79e9ad21
2021-06-27 10:36:11 +09:00
Nobuyoshi Nakada
bf789af28a
Added macros for days in month 2021-06-27 08:37:45 +09:00
Nobuyoshi Nakada
1fd8b6f2b9
Shrink monthly tables 2021-06-27 08:37:42 +09:00
git
b1428b279f * 2021-06-27 [ci skip] 2021-06-27 04:32:56 +09:00
Jeremy Evans
e86c1f6fc5
Work around issue transcoding issue with non-ASCII compatible encodings and xml escaping
When using a non-ASCII compatible source and destination encoding
and xml escaping (the :xml option to String#encode), the resulting
string was broken, as it used the correct non-ASCII compatible
encoding, but contained data that was ASCII-compatible instead of
compatible with the string's encoding.

Work around this issue by detecting the case where both the
source and destination encoding are non-ASCII compatible, and
transcoding the source string from the non-ASCII compatible
encoding to UTF-8. The xml escaping code will correctly handle
the UTF-8 source string and the return the correctly encoded
and escaped value.

Fixes [Bug #12052]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-06-26 12:32:39 -07:00
Nobuyoshi Nakada
391abc543c
Scan the coderange in the given encoding 2021-06-26 16:05:15 +09:00
Yusuke Endoh
457a4913be Disable RBIMPL_ATTR_DEPRECATED for Coverity Scan build
Coverity Scan emulates gcc but seems not to support this attribute
correctly.
2021-06-26 02:30:23 +09:00
git
c86f03be55 * 2021-06-26 [ci skip] 2021-06-26 00:15:38 +09:00
Yusuke Endoh
68e1dc5172 iseq.c: Make ast_line_count return 0 when syntax error occurred
This broke coverage CI

```
  1) Failure:
TestRequire#test_load_syntax_error [/home/runner/work/actions/actions/ruby/test/ruby/test_require.rb:228]:
Exception(SyntaxError) with message matches to /unexpected/.
[SyntaxError] exception expected, not #<TypeError: no implicit conversion of false into Integer>.
```
2914743968
2021-06-26 00:15:16 +09:00
aycabta
5ffb313ccc Revert "Revert "[ruby/reline] Fix failed test""
I'm so sorry, the previous revert was just a mistake.

This reverts commit 9103c3ba8b.
2021-06-25 18:56:46 +09:00
aycabta
9103c3ba8b Revert "[ruby/reline] Fix failed test"
This reverts commit 491591c7cee842601118efc2698e0e41283827b3.
2021-06-25 17:42:45 +09:00
Samuel Williams
bf376cae0c [ruby/reline] Fix missing require.
010b28dfe9
2021-06-25 17:42:45 +09:00
Samuel Williams
e788481843 [ruby/reline] Avoid using blocking IO.select.
de94746393
2021-06-25 17:42:45 +09:00
ima1zumi
d340b091a8 [ruby/reline] Fix failed test
For ruby/ruby repository's AppVeyor CI (Windows environment), `Reline::IOGate.encoding` will be changed from `UTF-8` to `Windows-31J` after the test is run.
So, when `test/reline/test_key_actor_emacs.rb` is loaded, `Reline::IOGate.encoding == Encoding::UTF_8` will be `true`,
but at the time of test execution, `Reline::IOGate.encoding` is `Windows-31J`.
For this reason, I changed the test method to check `Reline::IOGate.encoding` in the test method.

10e1ce3320
2021-06-25 17:42:45 +09:00
Hiroshi SHIBATA
b048fd572a
Followed up 66d2fc7989 2021-06-25 17:27:17 +09:00
Aaron Patterson
b036a44e57
[ruby/racc] Remove Object monkey patch
I don't think we need this monkey patch anymore, so lets remove it!

464485e912
2021-06-25 17:26:27 +09:00
Hiroshi SHIBATA
7641a83d1f
[ruby/racc] Removed needless condition for old versions of RubyGems.
fe3183b1ff
2021-06-25 17:26:27 +09:00
Hiroshi SHIBATA
dd0a9507a2
[ruby/racc] Drop to support Ruby 2.4
5af1a42a3b
2021-06-25 17:26:27 +09:00
Hiroshi SHIBATA
77c1f6b1ec
[ruby/racc] Followed up #162
d66cd12166
2021-06-25 17:26:27 +09:00
Jean Boussier
71344a1d63 [ruby/racc] Stop compressing integer lists
It is unclear why this was implemented, I assume
it was for performance back in 2006.

However today, this compression defeats bytecode caching
entirely and end up being counter productive.

ae3703c1d0
2021-06-25 17:23:06 +09:00
Jeremy Evans
be230615d0 Remove shift of ep when computing Proc#hash
The shift was causing far fewer unique values of hash than expected.

Fix pointed out by xtkoba (Tee KOBAYASHI)

Fixes [Bug #17951]
2021-06-24 12:25:33 -07:00
git
3ab68b910f * 2021-06-25 [ci skip] 2021-06-25 04:22:30 +09:00
Jeremy Evans
a2592702ae Actually ignore FNM_CASEFOLD flag in Dir.glob
This was already documented as being ignored, but it wasn't being
ignored, causing an issue in a particular case where a UTF-8
pattern was provided and a filename was tested that wasn't valid
UTF-8.

Fixes [Bug #14456]
2021-06-24 12:22:09 -07:00
Nobuyoshi Nakada
189f154786
[DOC] fixed return value of ENV.clone [ci skip] 2021-06-24 21:53:59 +09:00
Nobuyoshi Nakada
fb978fab6d
Tests for MiniTest define anonymous test cases 2021-06-24 20:39:52 +09:00
Nobuyoshi Nakada
e1c3cb9357
test: imply random test order by --seed option 2021-06-24 18:52:35 +09:00
Nobuyoshi Nakada
627aafac86
Remove also debug symbol directory at clean on macOS 2021-06-24 17:04:42 +09:00
Nobuyoshi Nakada
1356b90c91
Prefer configured command as RM_RF 2021-06-24 17:04:41 +09:00
Nobuyoshi Nakada
358a357f72
Reduce repeated same code 2021-06-24 13:27:02 +09:00
Nobuyoshi Nakada
4c8c3fb230
Load rubygems before default gems 2021-06-24 13:01:47 +09:00
Nobuyoshi Nakada
6875408583
Introduced RUBY_CRLF_ENVIRONMENT to simplify repeated condition 2021-06-24 13:01:46 +09:00
卜部昌平
0fbdaaf7c9 rand_bytes: prefer rng->get_bytes
Because why not.  There was no use case of rng->get_bytes before this
changeset.
2021-06-24 12:48:17 +09:00
eileencodes
31f4d26273 Check type of instruction - can be INSN or ADJUST
If the type is ADJUST we don't want to treat it like an INSN so we have
to check the type before reading from `insn_info.events`.

[Bug #18001] [ruby-core:104371]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-06-23 11:34:37 -07:00
git
b29c48efc0 * 2021-06-24 [ci skip] 2021-06-24 02:03:26 +09:00