diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml index 1a9b43ec5241a9..9ef89f89ff2b05 100644 --- a/.github/workflows/sync_default_gems.yml +++ b/.github/workflows/sync_default_gems.yml @@ -59,6 +59,10 @@ jobs: git pull --rebase origin ${GITHUB_REF#refs/heads/} git push origin ${GITHUB_REF#refs/heads/} if: ${{ steps.sync.outputs.update }} + env: + EMAIL: svn-admin@ruby-lang.org + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git - uses: ./.github/actions/slack with: diff --git a/NEWS.md b/NEWS.md index 3c2957d032579f..e33408054ea5e4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -206,7 +206,7 @@ The following default gems are updated. * prism 1.6.0 * psych 5.2.6 * resolv 0.6.3 -* stringio 3.1.8.dev +* stringio 3.1.9.dev * strscan 3.1.6.dev * timeout 0.4.4 * uri 1.1.1 diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 5da0b4c9457a2e..17be72f71a8cb6 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -13,7 +13,7 @@ **********************************************************************/ static const char *const -STRINGIO_VERSION = "3.1.8.dev"; +STRINGIO_VERSION = "3.1.9.dev"; #include diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb index 914c8465032fdc..49fb90249dd6ae 100644 --- a/lib/bundled_gems.rb +++ b/lib/bundled_gems.rb @@ -20,17 +20,17 @@ module Gem::BUNDLED_GEMS # :nodoc: "resolv-replace" => "3.4.0", "rinda" => "3.4.0", "syslog" => "3.4.0", - "ostruct" => "3.5.0", - "pstore" => "3.5.0", - "rdoc" => "3.5.0", - "win32ole" => "3.5.0", - "fiddle" => "3.5.0", - "logger" => "3.5.0", - "benchmark" => "3.5.0", - "irb" => "3.5.0", - "reline" => "3.5.0", - # "readline" => "3.5.0", # This is wrapper for reline. We don't warn for this. - "tsort" => "3.6.0", + "ostruct" => "4.0.0", + "pstore" => "4.0.0", + "rdoc" => "4.0.0", + "win32ole" => "4.0.0", + "fiddle" => "4.0.0", + "logger" => "4.0.0", + "benchmark" => "4.0.0", + "irb" => "4.0.0", + "reline" => "4.0.0", + # "readline" => "4.0.0", # This is wrapper for reline. We don't warn for this. + "tsort" => "4.1.0", }.freeze EXACT = { diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb index e6cacbaf9e832a..1cfc331582748e 100644 --- a/lib/error_highlight/core_ext.rb +++ b/lib/error_highlight/core_ext.rb @@ -24,7 +24,7 @@ module CoreExt _, _, snippet, highlight = ErrorHighlight.formatter.message_for(spot).lines out += "\n | #{ snippet } #{ highlight }" else - out += "\n (cannot highlight method definition; try Ruby 3.5 or later)" + out += "\n (cannot highlight method definition; try Ruby 4.0 or later)" end end ret << "\n" + out if out diff --git a/lib/net/http.rb b/lib/net/http.rb index c60649b8123c09..1a13299d202aa0 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -2587,7 +2587,7 @@ def debug(msg) alias_method :D, :debug end - # for backward compatibility until Ruby 3.5 + # for backward compatibility until Ruby 4.0 # https://bugs.ruby-lang.org/issues/20900 # https://github.com/bblimke/webmock/pull/1081 HTTPSession = HTTP diff --git a/numeric.c b/numeric.c index de5b02aaf9eb41..731a8095239107 100644 --- a/numeric.c +++ b/numeric.c @@ -5553,7 +5553,7 @@ rb_int_digits_bigbase(VALUE num, VALUE base) } bases = rb_ary_new(); - for (VALUE b = base; int_lt(b, num) == Qtrue; b = rb_int_mul(b, b)) { + for (VALUE b = base; int_le(b, num) == Qtrue; b = rb_int_mul(b, b)) { rb_ary_push(bases, b); } digits = rb_ary_new_from_args(1, num); diff --git a/spec/bundled_gems_spec.rb b/spec/bundled_gems_spec.rb index 8014a48223c8cf..c2a655929ab7bf 100644 --- a/spec/bundled_gems_spec.rb +++ b/spec/bundled_gems_spec.rb @@ -113,7 +113,7 @@ def script(code, options = {}) require "active_support/all" RUBY - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/lib\/active_support\/all\.rb:1/) end @@ -159,7 +159,7 @@ def script(code, options = {}) bundle "exec ruby script.rb" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/script\.rb:8/) end @@ -177,7 +177,7 @@ def script(code, options = {}) bundle "exec ./script.rb" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/script\.rb:9/) end @@ -186,7 +186,7 @@ def script(code, options = {}) create_file("Gemfile", "source 'https://rubygems.org'") bundle "exec ruby -r./stub -ropenssl -e ''" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) end it "Show warning when warn is not the standard one in the current scope" do @@ -209,7 +209,7 @@ def my My.my RUBY - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/-e:19/) end @@ -251,7 +251,7 @@ def my require Gem::BUNDLED_GEMS::ARCHDIR + 'openssl' RUBY - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) # TODO: We should assert caller location like below: # test_warn_bootsnap.rb:14: warning: ... end @@ -320,7 +320,7 @@ def my create_file("Gemfile", "source 'https://rubygems.org'") bundle "exec ruby script.rb" - expect(err).to include(/openssl used to be loaded from (.*) since Ruby 3.5.0/) + expect(err).to include(/openssl used to be loaded from (.*) since Ruby 4.0.0/) expect(err).to include(/script\.rb:13/) end diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb index d750218452ebcf..96cd7be4720a66 100644 --- a/spec/bundler/spec_helper.rb +++ b/spec/bundler/spec_helper.rb @@ -27,6 +27,8 @@ require "rspec/expectations" require "rspec/mocks" require "rspec/support/differ" +gem "rubygems-generate_index" +require "rubygems/indexer" require_relative "support/builders" require_relative "support/checksums" diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index 5ca227cf5b3aa3..1283dc4348821d 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -279,14 +279,8 @@ def update_repo(path, build_compact_index: true) @_build_path = "#{path}/gems" @_build_repo = File.basename(path) yield - with_gem_path_as scoped_base_system_gem_path do - Dir[scoped_base_system_gem_path.join("gems/rubygems-generate_index*/lib")].first || - raise("Could not find rubygems-generate_index lib directory in #{scoped_base_system_gem_path}") - - command = "generate_index" - command += " --no-compact" if !build_compact_index && gem_command(command + " --help").include?("--[no-]compact") - gem_command command, dir: path - end + options = { build_compact: build_compact_index } + Gem::Indexer.new(path, options).generate_index ensure @_build_path = nil @_build_repo = nil diff --git a/test/error_highlight/test_error_highlight.rb b/test/error_highlight/test_error_highlight.rb index 43e232071f9371..1276a0a0d93a7b 100644 --- a/test/error_highlight/test_error_highlight.rb +++ b/test/error_highlight/test_error_highlight.rb @@ -1468,7 +1468,7 @@ def test_wrong_number_of_arguments_for_method MethodDefLocationSupported ? "| def wrong_number_of_arguments_test(x, y) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1494,7 +1494,7 @@ def test_missing_keyword MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1515,7 +1515,7 @@ def test_missing_keywords # multiple missing keywords MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1536,7 +1536,7 @@ def test_unknown_keyword MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1557,7 +1557,7 @@ def test_unknown_keywords MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1587,7 +1587,7 @@ def test_wrong_number_of_arguments_for_method2 MethodDefLocationSupported ? "| def wrong_number_of_arguments_test2( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1609,7 +1609,7 @@ def test_wrong_number_of_arguments_for_lambda_literal MethodDefLocationSupported ? "| v = -> {} ^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1631,7 +1631,7 @@ def test_wrong_number_of_arguments_for_lambda_method MethodDefLocationSupported ? "| v = lambda { } ^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END @@ -1657,7 +1657,7 @@ def test_wrong_number_of_arguments_for_define_method MethodDefLocationSupported ? "| define_method :define_method_test do |x, y| ^^" : - "(cannot highlight method definition; try Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 4.0 or later)" } END diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index dd6f4baa4c292b..c366f794b2a1f5 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -821,6 +821,9 @@ def test_digits assert_equal([7215, 2413, 6242], T1024P.digits(10_000).first(3)) assert_equal([11], 11.digits(T1024P)) assert_equal([T1024P - 1, 1], (T1024P + T1024P - 1).digits(T1024P)) + bug21680 = '[ruby-core:123769] [Bug #21680]' + assert_equal([0] * 64 + [1], (2**512).digits(256), bug21680) + assert_equal([0] * 128 + [1], (123**128).digits(123), bug21680) end def test_digits_for_negative_numbers diff --git a/tool/bundler/dev_gems.rb b/tool/bundler/dev_gems.rb index 0d4dbd7f2ee058..0039a42171aa41 100644 --- a/tool/bundler/dev_gems.rb +++ b/tool/bundler/dev_gems.rb @@ -12,6 +12,7 @@ gem "rspec-core", "~> 3.12" gem "rspec-expectations", "~> 3.12" gem "rspec-mocks", "~> 3.12" +gem "rubygems-generate_index", "~> 1.1" group :doc do gem "ronn-ng", "~> 0.10.1", platform: :ruby diff --git a/tool/bundler/dev_gems.rb.lock b/tool/bundler/dev_gems.rb.lock index bc1d2acfc98da8..7f73c43f4cc1dd 100644 --- a/tool/bundler/dev_gems.rb.lock +++ b/tool/bundler/dev_gems.rb.lock @@ -1,6 +1,7 @@ GEM remote: https://rubygems.org/ specs: + compact_index (0.15.0) diff-lcs (1.6.1) kramdown (2.5.1) rexml (>= 3.3.9) @@ -54,6 +55,8 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.2) + rubygems-generate_index (1.1.3) + compact_index (~> 0.15.0) test-unit (3.6.7) power_assert turbo_tests (2.2.5) @@ -83,10 +86,12 @@ DEPENDENCIES rspec-core (~> 3.12) rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) + rubygems-generate_index (~> 1.1) test-unit (~> 3.0) turbo_tests (~> 2.2.3) CHECKSUMS + compact_index (0.15.0) sha256=5c6c404afca8928a7d9f4dde9524f6e1610db17e675330803055db282da84a8b diff-lcs (1.6.1) sha256=12a5a83f3e37a8e2f4427268e305914d5f1879f22b4e73bb1a09f76a3dd86cd4 kramdown (2.5.1) sha256=87bbb6abd9d3cebe4fc1f33e367c392b4500e6f8fa19dd61c0972cf4afe7368c kramdown-parser-gfm (1.1.0) sha256=fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729 @@ -115,6 +120,7 @@ CHECKSUMS rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58 rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec + rubygems-generate_index (1.1.3) sha256=3571424322666598e9586a906485e1543b617f87644913eaf137d986a3393f5c test-unit (3.6.7) sha256=c342bb9f7334ea84a361b43c20b063f405c0bf3c7dbe3ff38f61a91661d29221 turbo_tests (2.2.5) sha256=3fa31497d12976d11ccc298add29107b92bda94a90d8a0a5783f06f05102509f