Commit graph

66877 commits

Author SHA1 Message Date
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
eileencodes
8209b73580 Evacuate transient heap when enabling ractors
If the GC has been disabled we need to re-enable it so we can evacuate
the transient heap.

Fixes https://bugs.ruby-lang.org/issues/17985

[Bug #17985] [ruby-core:104260]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-06-23 10:03:09 -07:00
Ketan Bhatt
2fb435b3ab Add Related link from String#hash to Object#hash
We came across a bug in our code because we assumed `String#hash` to be consistent across Ruby processes, which was incorrect.

Our search lead us to `Object#hash` which has the right warning that `String#hash` doesn't. We also noticed that a previous version of the documentation for `String#hash` pointed to `Object#hash` that was removed by https://github.com/ruby/ruby/pull/3565.
We think this removal might not be intended and just got missed amidst other changes.
2021-06-23 07:42:02 -07:00
Jeremy Evans
7c31ecd3ac Add parentheses to avoid pointless condition
Pointed out by xtkoba (Tee KOBAYASHI).

Fixes [Bug #17946]
2021-06-23 21:48:42 +09:00
aycabta
557b4eb4aa Add detailed message to assert_external_string_equal 2021-06-23 21:00:48 +09:00
Nobuyoshi Nakada
298d65b1e4
Discard RDOCOPT environment variable to make tests stable 2021-06-23 18:57:39 +09:00
Nobuyoshi Nakada
09e7a0c4a4
Dispose the global rubygems configuration wholely 2021-06-23 18:56:10 +09:00
Nobuyoshi Nakada
ddb8739634
Clear rdoc options in the global rubygems configuration 2021-06-23 18:46:53 +09:00
Nobuyoshi Nakada
69ce9e4187
Clear default configurations
Remove environment variables which can affect the default
configurations.
2021-06-23 15:14:21 +09:00
Nobuyoshi Nakada
950c7a12ef
Make temporary directory under the regular location 2021-06-23 14:17:43 +09:00
Nobuyoshi Nakada
923b365224
Close UserInteraction for tests to fix leaked file descriptors 2021-06-23 12:52:32 +09:00
Nobuyoshi Nakada
8f16a715e1
Revert deprecations for now 2021-06-23 12:41:54 +09:00
Hiroshi SHIBATA
6aaa1c4d09 [ruby/rdoc] Use pend instead of skip
8460a36d84
2021-06-23 11:05:18 +09:00
Hiroshi SHIBATA
193eea9dcd [ruby/rdoc] Specify working directory for RDoc::Options#check_files
f6cca9bd2f
2021-06-23 11:05:16 +09:00
Hiroshi SHIBATA
f2e39e5fed [ruby/rdoc] Update test/rdoc/test_rdoc_rubygems_hook.rb
fb264c4cc4

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-06-23 11:05:14 +09:00
Hiroshi SHIBATA
c483aa8394 [ruby/rdoc] Rwrite test-case for rubygems_hook without Gem::TestCase
f8d1087ce5
2021-06-23 11:05:11 +09:00
Nobuyoshi Nakada
def7b3ee09
Get rid of pointer casting 2021-06-23 10:55:23 +09:00
Nobuyoshi Nakada
0700ee0e94
Refactor class variable cache functions
Extracted repeated code as update_classvariable_cache.  When cvc
table is not set in getclassvariable, an empty table was created
but it has no id and would cause [BUG], so made the code same as
setclassvariable.
2021-06-23 10:55:22 +09:00
S-H-GAMELINKS
46ff44ef17 Add nilclass.rb to .document 2021-06-23 10:23:10 +09:00