Commit graph

15017 commits

Author SHA1 Message Date
Nobuyoshi Nakada
a55eb9a2af
Make reciprocal properly of non-integral rational [Bug #17572] 2021-01-23 10:30:59 +09:00
Felix Wolfsteller
e34f51fe60 [ruby/matrix] Add Matrix#rotate_entries [#19]
Co-authored-by: Marc-André Lafortune <github@marc-andre.ca>
2021-01-21 13:22:25 -05:00
Nobuyoshi Nakada
d961f14df3 [ruby/net-http] RubyVM::MJIT is deprecated, prefer RubyVM::JIT now
abc6ea1877
2021-01-21 20:50:23 +09:00
Takashi Kokubun
922989fa0f [ruby/erb] Warn safe_level and later args even without -w
because, when Ruby 3.1 is released, Ruby 2.5, the last version with the
old method signature, will have been EOL. Therefore we can safely warn
the old interface from Ruby 3.1.

c3a753f49f
2021-01-21 13:52:02 +09:00
Takashi Kokubun
47b43807a8 [ruby/erb] Make sure erb.rb in this repository is tested
012faba2e5
2021-01-21 13:12:03 +09:00
Nobuyoshi Nakada
565aeb81e0 Skip freezing check on setting temporary class path [Bug #17563]
Co-authored-by: ryannevell (Ryan Nevell) <ryan.nevell@gmail.com>
2021-01-20 19:24:16 +09:00
Takashi Kokubun
f4a556f4f1 [ruby/irb] Remove pp-specific stub from TestColor
because it was for TestColorPrinter

7569206fd4
2021-01-20 18:10:20 +09:00
Takashi Kokubun
cea6814c2c [ruby/irb] Undefine unused constants
eea9c16804
2021-01-20 18:07:40 +09:00
Takashi Kokubun
328df00712 [ruby/irb] Split test files for IRB::Color and IRB::ColorPrinter
d95e8daab3
2021-01-20 18:03:37 +09:00
Takashi Kokubun
10d12afa41 [ruby/erb] Prefer __dir__ to reduce ../
cb59f11ec8
2021-01-20 17:46:50 +09:00
Takashi Kokubun
718890aa04 Pend erb command tests for Ruby 2.5 for now 2021-01-20 17:21:09 +09:00
Nobuyoshi Nakada
eeacdcb9a0 Fixed premature return
After setting ruby2_keywords for bmethod, the rest of arguments
had been ignored. [Bug #17558]
2021-01-19 17:59:37 +09:00
Takashi Kokubun
e6af81bde1 [ruby/irb] Stub a screen size for test_context
http://ci.rvm.jp/logfiles/brlog.trunk-random1.20210119-074232

ea87592d4a
2021-01-19 00:14:48 -08:00
Takashi Kokubun
4da4ad69bb [ruby/irb] Support GitHub Actions
8e9e6c4037
2021-01-18 23:55:51 -08:00
Takashi Kokubun
b2159f7c38 [ruby/irb] Stub a screen size for tests
6663057083
2021-01-18 23:35:50 -08:00
Takashi Kokubun
4886535ab2
Avoid suppressing unrelated warnings 2021-01-18 20:44:48 -08:00
Yusuke Endoh
f12320cd57 test/ruby/test_jit.rb: Avoid a warning
20210119T033003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20210119T033003Z/ruby/test/ruby/test_jit.rb:781:
warning: -e:5: warning: possibly useless use of -@ in void context
```
2021-01-19 13:40:39 +09:00
Yusuke Endoh
ff8c92359a test/ruby/test_pattern_matching.rb: Avoid a warning
20210119T033003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20210119T033003Z/ruby/test/ruby/test_pattern_matching.rb:798:
warning: assigned but unused variable - x
```
2021-01-19 13:34:07 +09:00
Vladimir Dementyev
1b89b99941
Mark pattern labels as unremoveable
Peephole optimization doesn't play well with find pattern at
least. The only case when a pattern matching could have
unreachable patterns is when we have lasgn/dasgn node, which
shouldn't happen in real-life.

Fixes https://bugs.ruby-lang.org/issues/17534
2021-01-19 08:34:01 +09:00
Takashi Kokubun
9d1475c621
Fix JIT link failures
forgotten in https://github.com/ruby/ruby/pull/4018
2021-01-18 14:52:33 -08:00
Nobuhiro IMAI
166f33d0d1 [ruby/irb] skip a failling test on TruffleRuby
* due to the difference of backtrace pointed out by @aycabta

5e00a0ae61
2021-01-18 02:13:01 +09:00
Nobuhiro IMAI
d290a02bd7 [ruby/irb] handle repeated exception separately
fcf6b34bc5
2021-01-18 02:12:53 +09:00
Nobuhiro IMAI
3f0b4665df [ruby/irb] handle __ENCODING__ as a keyword as well
a6a33d908f
2021-01-18 02:12:43 +09:00
aycabta
f3156e457d [ruby/reline] Windows needs more times to wait rendering
53ff2b09c7
2021-01-18 02:09:34 +09:00
aycabta
9279d3f255 [ruby/reline] Tests with yamatanooroti don't need chdir
Because of chdir, log files ware created in temporary directries on Windows.

200b469a68
2021-01-18 02:08:41 +09:00
Nobuyoshi Nakada
f96eaf54a2
Use the dedicated assertion 2021-01-17 21:55:48 +09:00
Takashi Kokubun
8d099aa040
Warn Struct#initialize with only keyword args (#4070)
* Warn Struct#initialize with only keyword args

A part of [Feature #16806]

* Do not warn if `keyword_init: false`

is explicitly specified

* Add a NEWS entry

* s/in/from/

* Make sure all fields are initialized
2021-01-17 01:35:54 -08:00
manga_osyo
b84b253a69 Fix Ripper with heredoc. 2021-01-17 12:58:13 +09:00
Kenta Murata
b130644584 [ruby/bigdecimal] Fix for the coerce cases in divide and DoDivmod
1cb92487f7
2021-01-16 00:09:26 +09:00
Nobuyoshi Nakada
0d57d59933 Keep encoding in the result of File.expand_path [Bug #17517] 2021-01-15 17:46:48 +09:00
Jeremy Evans
e09094546a Make Module#prepend affect ancestor chain even if argument already included in receiver
Previously, if a class included a module and then prepended the
same module, the prepend had no effect.  This changes the behavior
so that the prepend has an effect unless the module is already
prepended the receiver.

While here, rename the origin_seen variable in include_modules_at,
since it is misleading. The variable tracks whether c has been seen,
not whether the origin of klass has been.

Fixes [Bug #17423]
2021-01-14 20:43:30 -08:00
Takashi Kokubun
e1fee7f949
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.

[Feature #17490]
2021-01-13 22:46:51 -08:00
Aaron Patterson
efcdf68e64 Guard callinfo
Callinfo was being written in to an array and the GC would not see the
reference on the stack.  `new_insn_send` creates a new callinfo object,
then it calls `new_insn_core`.  `new_insn_core` allocates a new INSN
linked list item, which can end up calling `xmalloc` which will trigger
a GC:

  70cd351c7c/compile.c (L968-L969)

Since the callinfo object isn't on the stack, the GC won't see it, and
it can get collected.  This patch just refactors `new_insn_send` to keep
the object on the stack

Co-authored-by: John Hawthorn <john@hawthorn.email>
2021-01-13 16:13:53 -08:00
Nobuyoshi Nakada
0036648a42
Capture to reserved name variables if already defined [Bug #17533] 2021-01-13 21:16:00 +09:00
Nobuyoshi Nakada
e9b93d67ba
Positional and keyword arguments for timezone are exclusive
[Feature #17485]
2021-01-13 18:37:36 +09:00
Nobuyoshi Nakada
4b15caee8f
Added in: timezone option to Time.new [Feature #17485] 2021-01-13 18:15:50 +09:00
Nobuyoshi Nakada
6f6dfdcc68 Make warning values consistent [Bug #17523]
They should be affected, as well as `$VERBOSE`, by `-w`/`-W`
options, not only in the main script but in scripts loaded by `-r`
option too.
2021-01-13 18:12:49 +09:00
Nobuyoshi Nakada
85b5d4c8bf Revert "[Bug #11213] let defined?(super) call respond_to_missing?"
This reverts commit fac2498e02 for
now, due to [Bug #17509], the breakage in the case `super` is
called in `respond_to?`.
2021-01-13 18:11:46 +09:00
Nobuyoshi Nakada
9441f3f970 Allow UTC offset without colons per ISO-8601 [Bug #17504] 2021-01-13 16:37:59 +09:00
Marc-Andre Lafortune
f48edc28dd Fix method protection for modules in the ancestry chain.
[Fixes ruby/ostruct#23]
2021-01-12 23:29:39 -05:00
Kenta Murata
a5b4b806de
[ruby/bigdecimal] Allow digits=0 in BigDecimal(flt) and Float#to_d
Using dtoa of mode=0, we can determine the number of digits in decimal that is
necessary to represent the given Float number without errors.

This change permits digits=0 in BigDecimal(flt) and Float#to_d, and these
methods use dtoa of mode=0 when the given digits is 0.

Internal implicit conversion from Float also uses digits=0.

[Fix GH-70]

2dbe170e35
2021-01-13 11:49:18 +09:00
Hiroshi SHIBATA
30f1316401
Skip test when UDP server is no response. 2021-01-13 11:27:30 +09:00
Kenta Murata
2175c2c957 [ruby/bigdecimal] Use pre-allocated objects for special values
95c201f2d3
2021-01-13 01:58:23 +09:00
Kenta Murata
6670de82c2
[ruby/bigdecimal] Fix exception message raised in Kernel.BigDecimal
d163f170a4
ff8eeeb064
2021-01-13 01:27:04 +09:00
aycabta
eb5a094fc0 [ruby/reline] Move the cursor correctly when deleting at eol
This fixes ruby/reline#246.

07a73ba601
2021-01-13 01:12:54 +09:00
aycabta
44817db28b [ruby/reline] Handle ed_search_{prev,next}_history in multiline correctly
The current line was being handled incorrectly when displaying the hit
history, so it has been fixed to be correct.

a3df4343b3
2021-01-13 01:12:54 +09:00
Hiroshi SHIBATA
0dc95266e8
Fix the failing test with XDG_CONFIG_HOME 2021-01-12 20:15:18 +09:00
Nobuyoshi Nakada
7dc0511ea4 Remove "." and ".." from Dir.glob with FNM_DOTMATCH [Bug #17280]
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2021-01-12 20:02:43 +09:00
Nobuyoshi Nakada
1eb8eb55c2
Convert time component strings to integers more strictly
https://bugs.ruby-lang.org/issues/17485#change-89871
2021-01-12 17:24:43 +09:00
Nobuyoshi Nakada
b017848f8a
Show seconds of utc_offset if not zero 2021-01-12 17:00:14 +09:00