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

66149 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 9620a30b1b [rubygems/rubygems] Fixed an intentional blank-line
https://github.com/rubygems/rubygems/commit/795b572ac2
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 655727ee1b [rubygems/rubygems] Added comment for Minitest::Mock
https://github.com/rubygems/rubygems/commit/ae44b68d57
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA d33888bf96 [rubygems/rubygems] Replace skip to pend
https://github.com/rubygems/rubygems/commit/0b145135c7
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 129bc04ab7 [rubygems/rubygems] util/rubocop -a
https://github.com/rubygems/rubygems/commit/a10ff97830
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 00f5b4b546 [rubygems/rubygems] Don't use Minitest::Mock
https://github.com/rubygems/rubygems/commit/d3fa893597
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 3456335a9c [rubygems/rubygems] Removed minitest/mock from test/rubygems/test_gem_remote_fetcher.rb
https://github.com/rubygems/rubygems/commit/f1af59fe02
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA ff3f990499 [rubygems/rubygems] Removed minitest/mock from test_gem_package_tar_writer.rb
https://github.com/rubygems/rubygems/commit/45464bfcbd
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 7b3b48549b [rubygems/rubygems] capture_output will return empty string, not nil
https://github.com/rubygems/rubygems/commit/3fa93f6144
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 9b5e4ce611 [rubygems/rubygems] Fixed variable scope at test_silent_system
https://github.com/rubygems/rubygems/commit/bfcdf79657
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA d5237c5d10 [rubygems/rubygems] Import capture_subprocess_io from minitest
https://github.com/rubygems/rubygems/commit/8b2ca6df3a
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA cd375e455e [rubygems/rubygems] Rewrite with capture_output
https://github.com/rubygems/rubygems/commit/a091004ded
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 5ed9d3f16f [rubygems/rubygems] Use capture_output instead of capture_io
https://github.com/rubygems/rubygems/commit/c46185abe3
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA c30594bb0c [rubygems/rubygems] Use assert_raise instead of assert_raises
https://github.com/rubygems/rubygems/commit/769e87f011
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 2c0072dec5 [rubygems/rubygems] Use dummy assertion for assert_https
https://github.com/rubygems/rubygems/commit/64d843fe17
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA a1c416460b [rubygems/rubygems] Use capture_output instead of assert_silent
https://github.com/rubygems/rubygems/commit/3225aab7f8
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 958f9d425a [rubygems/rubygems] Use capture_output instead of capture_io for test-unit
https://github.com/rubygems/rubygems/commit/ab9c80d4cb
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 3948be3503 [rubygems/rubygems] Use assert_path_exist and assert_path_not_exist instead of assert_path_exists and refute_path_exists
https://github.com/rubygems/rubygems/commit/a7c93558c3
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 81d793a921 [rubygems/rubygems] Extract assert_output to assert_empty and assert_equal with capture_output
https://github.com/rubygems/rubygems/commit/f6759440a4
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 183174475c [rubygems/rubygems] Use Regexp with refute_match
https://github.com/rubygems/rubygems/commit/51fdbe53bc
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 3c9633acfc [rubygems/rubygems] Also use capture_output instead of capture_io
https://github.com/rubygems/rubygems/commit/229858ea56
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA 26cbda8dc9 [rubygems/rubygems] Use capture_output instead of capture_io.
https://github.com/rubygems/rubygems/commit/ad9206d4d0
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA cddeee21e9 [rubygems/rubygems] Use test-unit instead of minitest
https://github.com/rubygems/rubygems/commit/a8571524ad
2021-05-12 17:24:43 +09:00
Koichi Sasada 5a6af44e20 skip test for debug.
test_memsize_of_iseq fails on repeat tests and it seems to difficult
to solve immediately. Now this test is skipped.

It seems that the result of `memsize_of(Object.new)` are increased.
Why...?
2021-05-12 12:57:53 +09:00
Koichi Sasada 3df7c967bb suppress warnings on repeat tests.
Constant definitions are affect on outer namespace of an anonymous
module. To define constants on the anonymous module, this patch
uses Module#class_eval(str).
2021-05-12 12:53:14 +09:00
卜部昌平 6911b4bc82 test_cdhash: refactor change class
It is now strange to test Complex in a class named Rational_Test.
2021-05-12 10:30:46 +09:00
卜部昌平 0ab0b86c84 cdhash_cmp: should use ||
cf: https://github.com/ruby/ruby/pull/4469#discussion_r628386707
2021-05-12 10:30:46 +09:00
卜部昌平 e1eff837cf cdhash_cmp: recursively apply
For instance a rational's numerator can be a bignum.  Comparison using
C's == can be insufficient.
2021-05-12 10:30:46 +09:00
卜部昌平 cc0dc67bbb cdhash_cmp: can also take complex
There are complex literals `123i`, which can also be a case condition.
2021-05-12 10:30:46 +09:00
卜部昌平 d0e6c6e682 cdhash_cmp: rational literals with fractions
Nobu kindly pointed out that rational literals can have fractions.
2021-05-12 10:30:46 +09:00
卜部昌平 2bc293e899 cdhash_cmp: can take rational literals
Rational literals are those integers suffixed with `r`.  They tend to
be a part of more complex expressions like `123/456r`, but in theory
they can live alone.  When such "bare" rational literals are passed to
case-when branch, we have to take care of them.  Fixes [Bug #17854]
2021-05-12 10:30:46 +09:00
Shugo Maeda 773c690f25 [ruby/net-ftp] Bump version to 0.1.2
https://github.com/ruby/net-ftp/commit/895ba44b3c
2021-05-12 09:20:41 +09:00
Jeremy Evans ee1725cecb Update keyword argument description in method syntax guide
Remove discussion of Ruby 2.7 specific handling of keyword
argument separation.  Add a small example of keyword to
positional hash conversion for methods not accepting
keyword arguments.
2021-05-11 15:45:52 -07:00
Takashi Kokubun cc1ea6e023
Run nmake check on Actions (#4487)
* Run nmake check on Actions

* Skip tests not working in mswin GitHub Actions

* Override TEMP

* Revert "Skip tests not working in mswin GitHub Actions"

This reverts commit 544d2575fcdf23ae63cd25aa03fce10c28b259f2.

* Revert "Revert "Skip tests not working in mswin GitHub Actions""

This reverts commit e1f8ad7862c9c4be52dc6e1031a004621eb07e6e.

* Fix timeouts

* Skip some more broken tests

* Update windows.yml

* Add a guard for rbasic_spec

* Revert "Update windows.yml"

This reverts commit bc9694b6b3b9594d406378d15ca11723fb052bc8.

* Skip the ensure clause

* Simplify the ensure
2021-05-11 15:18:44 -07:00
Aaron Patterson 07f055bb13
Revert "Filling cache values on cvar write"
This reverts commit 08de37f9fa.
This reverts commit e8ae922b62.
2021-05-11 13:31:00 -07:00
eileencodes 08de37f9fa Filling cache values on cvar write
Instead of on read. Once it's in the inline cache we never have to make
one again. We want to eventually put the value into the cache, and the
best opportunity to do that is when you write the value.
2021-05-11 12:04:27 -07:00
eileencodes e8ae922b62 Add a cache for class variables
This change implements a cache for class variables. Previously there was
no cache for cvars. Cvar access is slow due to needing to travel all the
way up th ancestor tree before returning the cvar value. The deeper the
ancestor tree the slower cvar access will be.

The benefits of the cache are more visible with a higher number of
included modules due to the way Ruby looks up class variables. The
benchmark here includes 26 modules and shows with the cache, this branch
is 6.5x faster when accessing class variables.

```
compare-ruby: ruby 3.1.0dev (2021-03-15T06:22:34Z master 9e5105ca45) [x86_64-darwin19]
built-ruby: ruby 3.1.0dev (2021-03-15T12:12:44Z add-cache-for-clas.. c6be0093ae) [x86_64-darwin19]

|         |compare-ruby|built-ruby|
|:--------|-----------:|---------:|
|vm_cvar  |      5.681M|   36.980M|
|         |           -|     6.51x|
```

Benchmark.ips calling `ActiveRecord::Base.logger` from within a Rails
application. ActiveRecord::Base.logger has 71 ancestors. The more
ancestors a tree has, the more clear the speed increase. IE if Base had
only one ancestor we'd see no improvement. This benchmark is run on a
vanilla Rails application.

Benchmark code:

```ruby
require "benchmark/ips"
require_relative "config/environment"

Benchmark.ips do |x|
  x.report "logger" do
    ActiveRecord::Base.logger
  end
end
```

Ruby 3.0 master / Rails 6.1:

```
Warming up --------------------------------------
              logger   155.251k i/100ms
Calculating -------------------------------------
```

Ruby 3.0 with cvar cache /  Rails 6.1:

```
Warming up --------------------------------------
              logger     1.546M i/100ms
Calculating -------------------------------------
              logger     14.857M (± 4.8%) i/s -     74.198M in   5.006202s
```

Lastly we ran a benchmark to demonstate the difference between master
and our cache when the number of modules increases. This benchmark
measures 1 ancestor, 30 ancestors, and 100 ancestors.

Ruby 3.0 master:

```
Warming up --------------------------------------
            1 module     1.231M i/100ms
          30 modules   432.020k i/100ms
         100 modules   145.399k i/100ms
Calculating -------------------------------------
            1 module     12.210M (± 2.1%) i/s -     61.553M in   5.043400s
          30 modules      4.354M (± 2.7%) i/s -     22.033M in   5.063839s
         100 modules      1.434M (± 2.9%) i/s -      7.270M in   5.072531s

Comparison:
            1 module: 12209958.3 i/s
          30 modules:  4354217.8 i/s - 2.80x  (± 0.00) slower
         100 modules:  1434447.3 i/s - 8.51x  (± 0.00) slower
```

Ruby 3.0 with cvar cache:

```
Warming up --------------------------------------
            1 module     1.641M i/100ms
          30 modules     1.655M i/100ms
         100 modules     1.620M i/100ms
Calculating -------------------------------------
            1 module     16.279M (± 3.8%) i/s -     82.038M in   5.046923s
          30 modules     15.891M (± 3.9%) i/s -     79.459M in   5.007958s
         100 modules     16.087M (± 3.6%) i/s -     81.005M in   5.041931s

Comparison:
            1 module: 16279458.0 i/s
         100 modules: 16087484.6 i/s - same-ish: difference falls within error
          30 modules: 15891406.2 i/s - same-ish: difference falls within error
```

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-05-11 12:04:27 -07:00
git c9e02d8919 * 2021-05-12 [ci skip] 2021-05-12 01:05:27 +09:00
Alan Wu 39a2ba5cc5
Method cache: fix refinement entry handling
To invalidate some callable method entries, we replace the entry in the
class. Most types of method entries are on the method table of the
origin class, but refinement entries without an orig_me are housed in
the method table of the class itself. They are there because refinements
take priority over prepended methods.

By unconditionally inserting a copy of the refinement entry into the
origin class, clearing the method cache created situations where there
are refinement entry duplicates in the lookup chain, leading to infinite
loops and other problems.

Update the replacement logic to use the right class that houses the
method entry. Also, be more selective about cache invalidation when
moving refinement entries for prepend. This avoids calling
clear_method_cache_by_id_in_class() before refinement entries are in the
place it expects.

[Bug #17806]
2021-05-11 12:05:06 -04:00
Hiroshi SHIBATA 010bb0883e
Workaround for make test-tool 2021-05-11 20:08:03 +09:00
Yusuke Endoh bb8a759f6b Fix a typo of c6a11b865e
It failed to define `refute_path_not_exist`
2021-05-11 19:46:15 +09:00
Yusuke Endoh 1b61cdd5e0 test/irb/test_raise_no_backtrace_exception.rb: Set LC_MESSAGES as UTF-8 2021-05-11 19:38:06 +09:00
Hiroshi SHIBATA c6a11b865e
Alias assert/refute_path_exists for test-unit gem.
It's required at https://github.com/rubygems/rubygems/pull/3141
2021-05-11 19:32:35 +09:00
Koichi ITO c45f7556b5 [ruby/irb] Fix `Encoding::ConverterNotFoundError`
Follow https://github.com/ruby/irb/pull/237.

This PR fixes the following `Encoding::ConverterNotFoundError`.

```console
% bin/spring stop && bin/rails c
Spring stopped.
Running via Spring preloader in process 58395
Loading development environment (Rails 6.0.3.7)
irb(main):001:0> "こんにちは".do_something
Traceback (most recent call last):
(snip)

    12: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:547:in `eval_input'
    11: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:232:in `each_top_level_statement'
    10: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:232:in `catch'
     9: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:233:in  `block in each_top_level_statement'
     8: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:233:in `loop'
     7: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:251:in `block (2 levels) in each_top_level_statement'
     6: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:548:in `block in eval_input'
     5: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:758:in `signal_status'
     4: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:586:in `block (2 levels) in eval_input'
     3: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:650:in `handle_exception'
     2: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `encode_with_invalid_byte_sequence'
     1: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `new'
/Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `initialize': code
converter not found (UTF-8 to UTF-8) (Encoding::ConverterNotFoundError)
```

First, this patch skips `Encoding::Converter.new` for the same encoding.
170531df19/lib/irb.rb (L601)

Next, this is a talk about the condition for skipping. `IRB.conf[:LC_MESSAGES].encoding`
becomes `"UTF-8"` string when `Reline.encoding_system_needs.name` is set in the below.
170531df19/lib/irb/input-method.rb (L269)

OTOH, `message.encoding` is `Encoding::UTF_8`, so these are compared as a string by this patch.

https://github.com/ruby/irb/commit/6df6e76cfc
2021-05-11 16:17:17 +09:00
Takashi Kokubun 66ca6ede16 [ruby/irb] Skip test_raise_exception_with_invalid_byte_sequence
on Windows for now. It seems like we haven't figured this out yet.

https://github.com/ruby/irb/commit/ecf5a1ace1
2021-05-11 14:46:33 +09:00
Takashi Kokubun afa70d079f
Explicitly specify encoding for another test as well
Same as e2ccc3301e
https://ci.appveyor.com/project/ruby/ruby/builds/39102539/job/k8m1yrrjesxbgvtq
2021-05-10 21:41:36 -07:00
Takashi Kokubun 7c346e1072
Split a Choco-Install command
In https://github.com/ruby/ruby/runs/2552065052, while it failed to
install winflexbison3, it exited the retry loop because openssl was
installed successfully.

a5ee51f72d/images/win/scripts/ImageHelpers/ChocoHelpers.ps1
2021-05-10 21:33:56 -07:00
Yusuke Endoh e2ccc3301e test/irb/test_raise_no_backtrace_exception.rb: UTF-8 is expected
... for the output of assert_in_out_err.

This will fix the following failure on many CI machines

http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20210511T030005Z.fail.html.gz
```
  1) Failure:
TestIRB::TestRaiseNoBacktraceException#test_raise_exception_with_different_encoding_containing_invalid_byte_sequence [/home/chkbuild/chkbuild/tmp/build/20210511T030005Z/ruby/test/irb/test_raise_no_backtrace_exception.rb:41]:
pid 221531 exit 0.

1. [1/2] Assertion for "stdout"
   | invalid byte sequence in US-ASCII.
```
2021-05-11 13:30:28 +09:00
Takashi Kokubun 3c9e30aef8
Try running Choco-Install with powershell
https://github.com/ruby/ruby/runs/2552047430
2021-05-10 21:17:36 -07:00
Takashi Kokubun 4ee72f4afd
Retry choco install
by using a wrapper provided by GitHub Actions
https://github.com/actions/virtual-environments/pull/721

to address failures like
https://github.com/ruby/ruby/runs/2551980671
2021-05-10 21:14:00 -07:00
Takashi Kokubun bb54361057 [ruby/irb] Skip the new IRB test on Windows for now
It's not passing from the beginning
https://github.com/ruby/ruby/runs/2550929220
https://ci.appveyor.com/project/ruby/ruby/builds/39100747

https://github.com/ruby/irb/commit/71fc180018
2021-05-11 13:01:38 +09:00