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

66923 Коммитов

Автор SHA1 Сообщение Дата
Samuel Williams 42130a64f0
Replace copy coroutine with pthread implementation. 2021-07-01 11:23:03 +12:00
Nobuyoshi Nakada 9c9531950c
rbinstall.rb: get rid of making directories when dryrun 2021-07-01 06:42:00 +09:00
Keiko Kaneko 8ee24840c8 [ruby/irb] Update ls.rb without requiring Set, because Set is one of standard libraries
https://github.com/ruby/irb/commit/7092ad2ab5
2021-07-01 05:16:31 +09:00
git 518d39388a * 2021-07-01 [ci skip] 2021-07-01 05:12:22 +09:00
Peter Zhu 4a3df35239 Use stride passed into os_obj_of_i 2021-06-30 16:12:03 -04:00
Takashi Kokubun acbddbe68c [ruby/irb] Rescue a specific error
Rescuing StandardError is prone to bugs caused by a typo or obsoleted methods.

https://github.com/ruby/irb/commit/eb5260fcd5
2021-06-30 21:06:52 +09:00
Masataka Pocke Kuwabara e8c2b03ee1 [ruby/irb] Fix error on `ls object_cant_define_singleton`
such as `ls 42`, `ls :sym` and so on

https://github.com/ruby/irb/commit/b1d436a853
2021-06-30 20:55:18 +09:00
Nobuyoshi Nakada 0feec79846
"nodoc" needs to exclude "doc" [ci skip] 2021-06-30 19:56:37 +09:00
Yusuke Endoh b6c910e1f4 [ruby/error_highlight] Allow the development version (= master branch) of Ruby 3.1
https://github.com/ruby/error_highlight/commit/2dca1446c9
2021-06-30 17:33:57 +09:00
Nobuyoshi Nakada 59ead88563
[DOC] add notes and examples for pipe [ci skip] 2021-06-30 15:45:21 +09:00
Yusuke Endoh 8ccc257434 Add the gemspec for error_highlight 2021-06-30 14:02:28 +09:00
Yusuke Endoh b270b5df2c Prevent "warning: ambiguity between regexp and two divisions" 2021-06-30 13:41:18 +09:00
Yusuke Endoh 6c6b128c67 [ruby/error_highlight] Bump version
https://github.com/ruby/error_highlight/commit/8d483c251e
2021-06-30 13:36:31 +09:00
Yusuke Endoh ca4e5b1eb3 [ruby/error_highlight] Reconsider the API of ErrorHighlight.spot
https://github.com/ruby/error_highlight/commit/acb2046a82
2021-06-30 12:49:27 +09:00
Yusuke Endoh f428ced69c [ruby/error_highlight] Experimentally support a custom formatter
https://github.com/ruby/error_highlight/commit/f40a1de20e
2021-06-30 12:49:18 +09:00
Yusuke Endoh db7e9b1aac [ruby/error_highlight] Add some comments
https://github.com/ruby/error_highlight/commit/e0c90c72c3
2021-06-30 11:46:47 +09:00
Yusuke Endoh 3391682eda tool/sync_default_gems.rb: remove unneeded code for error_highlight sync 2021-06-30 11:39:39 +09:00
Yusuke Endoh 393f84da4a tool/sync_default_gems.rb: Add error_highlight gem 2021-06-30 10:56:59 +09:00
Alan Wu 3dd3ea092a Use Module#ancestors order in recursive constant lookup
Before this commit, const_get with inherit=true and constant lookup
expressions searched the ancestors of the starting point in an order
different from `starting_point.ancestors`.

Items in the ancestry list introduced through prepend were searched
after searching the module they were prepended into. This oddity allowed
for situations where constant lookups gave different results even though
`starting_point.ancestors` is the same.

Do the lookup in the same order as `starting_point.ancestors` by
skipping classes and modules that have an origin iclass. The origin
iclass is in the super chain after the prepended modules.

Note that just like before this commit, the starting point of the
constant lookup is always the first item that we search, regardless of
the presence of any prepended modules.

[Bug #17887]
2021-06-30 10:49:27 +09:00
git dcd1eedba7 * 2021-06-30 [ci skip] 2021-06-30 10:47:24 +09:00
Nobuyoshi Nakada 94bd3bde81 Specify version to remove as bare numbers 2021-06-30 10:47:01 +09:00
Nobuyoshi Nakada 21600a5f64 Ensure that version number starts with digits 2021-06-30 10:47:01 +09:00
Nobuyoshi Nakada 0b726924a4 Show the removal version 2021-06-30 10:47:01 +09:00
Nobuyoshi Nakada 8118d435d0 rb_warn_deprecated_to_remove_at [Feature #17432]
At compilation time with RUBY_DEBUG enabled, check if the removal
version has been reached.
2021-06-30 10:47:01 +09:00
Yusuke Endoh d1998d8767 tool/test-bundled-gems.rb: Stop tests conflicting with error_highlight
This hack should be removed after the minitest side is updated.
https://github.com/seattlerb/minitest/pull/880
2021-06-29 23:45:49 +09:00
Yusuke Endoh 9438c99590 Rename error_squiggle to error_highlight 2021-06-29 23:45:49 +09:00
Yusuke Endoh e946049665 [WIP] add error_squiggle gem
```
$ ./local/bin/ruby -e '1.time {}'
-e:1:in `<main>': undefined method `time' for 1:Integer (NoMethodError)

1.time {}
 ^^^^^
Did you mean?  times
```

https://bugs.ruby-lang.org/issues/17930
2021-06-29 23:45:49 +09:00
Peter Zhu 03dc664493 Fix crash on RGENGC_CHECK_MODE=4
When running btest there is a crash when compiled with
RGENGC_CHECK_MODE=4. The crash happens because `during_gc` is not
turned off before `gc_marks_check` is called, causing the marking to
happen on the main mark stack instead of mark stack created in
`objspace_allrefs`.
2021-06-29 09:28:07 -04:00
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.

https://github.com/ruby/did_you_mean/commit/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?.

https://github.com/ruby/did_you_mean/commit/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`.

https://github.com/ruby/did_you_mean/commit/8352c154e3
2021-06-29 15:49:51 +09:00
Nobuyoshi Nakada 4670458af8 Should require "rbconfig" to use RbConfig
https://github.com/ruby/did_you_mean/commit/fbe5aaaae8
2021-06-29 15:49:51 +09:00
Yuki Nishijima 8356d9e374 Start v1.6.0 development
https://github.com/ruby/did_you_mean/commit/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.

https://github.com/ruby/irb/commit/27dd2867cd
2021-06-27 10:52:49 +09:00
Masataka Pocke Kuwabara 6eb7c663c6 [ruby/irb] Improve performance of `show_source` for large class
https://github.com/ruby/irb/commit/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