From 525ee3ab260039d71bc210e442686fdfc35262ee Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 26 Nov 2025 15:45:52 +0900 Subject: [PATCH 1/6] [ruby/cgi] Fix mixed declarations and code Use C90 syntax only, as far as supporting ruby 2.6 or earlier. https://github.com/ruby/cgi/commit/886c82982a --- ext/cgi/escape/escape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c index 6b00bc37c1753f..4773186603914e 100644 --- a/ext/cgi/escape/escape.c +++ b/ext/cgi/escape/escape.c @@ -45,6 +45,7 @@ escaped_length(VALUE str) static VALUE optimized_escape_html(VALUE str) { + VALUE escaped; VALUE vbuf; char *buf = ALLOCV_N(char, vbuf, escaped_length(str)); const char *cstr = RSTRING_PTR(str); @@ -63,7 +64,6 @@ optimized_escape_html(VALUE str) } } - VALUE escaped; if (RSTRING_LEN(str) < (dest - buf)) { escaped = rb_str_new(buf, dest - buf); preserve_original_state(str, escaped); From ecdeb90fe94af86c6d84fe343c1f95b7d801367a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 26 Nov 2025 13:39:21 +0900 Subject: [PATCH 2/6] [ruby/rubygems] Bump up to 4.0.0.beta2 https://github.com/ruby/rubygems/commit/b8529f48bf --- lib/bundler/version.rb | 2 +- lib/rubygems.rb | 2 +- spec/bundler/realworld/fixtures/tapioca/Gemfile.lock | 2 +- spec/bundler/realworld/fixtures/warbler/Gemfile.lock | 2 +- tool/bundler/dev_gems.rb.lock | 2 +- tool/bundler/rubocop_gems.rb.lock | 2 +- tool/bundler/standard_gems.rb.lock | 2 +- tool/bundler/test_gems.rb.lock | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index 4acf10c6153eaa..3a5b5fd86bdabc 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false module Bundler - VERSION = "4.0.0.beta1".freeze + VERSION = "4.0.0.beta2".freeze def self.bundler_major_version @bundler_major_version ||= gem_version.segments.first diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 8530a2a893cb5d..52ccf10159506b 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -9,7 +9,7 @@ require "rbconfig" module Gem - VERSION = "4.0.0.beta1" + VERSION = "4.0.0.beta2" end require_relative "rubygems/defaults" diff --git a/spec/bundler/realworld/fixtures/tapioca/Gemfile.lock b/spec/bundler/realworld/fixtures/tapioca/Gemfile.lock index 4a96e12169b72e..6f86f3192ec3a6 100644 --- a/spec/bundler/realworld/fixtures/tapioca/Gemfile.lock +++ b/spec/bundler/realworld/fixtures/tapioca/Gemfile.lock @@ -46,4 +46,4 @@ DEPENDENCIES tapioca BUNDLED WITH - 4.0.0.beta1 + 4.0.0.beta2 diff --git a/spec/bundler/realworld/fixtures/warbler/Gemfile.lock b/spec/bundler/realworld/fixtures/warbler/Gemfile.lock index 8a13873f01b2fc..42036fc23d17b4 100644 --- a/spec/bundler/realworld/fixtures/warbler/Gemfile.lock +++ b/spec/bundler/realworld/fixtures/warbler/Gemfile.lock @@ -36,4 +36,4 @@ DEPENDENCIES warbler! BUNDLED WITH - 4.0.0.beta1 + 4.0.0.beta2 diff --git a/tool/bundler/dev_gems.rb.lock b/tool/bundler/dev_gems.rb.lock index 29e0a574bba80a..cb2d6b4106f453 100644 --- a/tool/bundler/dev_gems.rb.lock +++ b/tool/bundler/dev_gems.rb.lock @@ -129,4 +129,4 @@ CHECKSUMS turbo_tests (2.2.5) sha256=3fa31497d12976d11ccc298add29107b92bda94a90d8a0a5783f06f05102509f BUNDLED WITH - 4.0.0.beta1 + 4.0.0.beta2 diff --git a/tool/bundler/rubocop_gems.rb.lock b/tool/bundler/rubocop_gems.rb.lock index 10a81012e4d6c1..5cd23d7ef8bb62 100644 --- a/tool/bundler/rubocop_gems.rb.lock +++ b/tool/bundler/rubocop_gems.rb.lock @@ -156,4 +156,4 @@ CHECKSUMS unicode-emoji (4.1.0) sha256=4997d2d5df1ed4252f4830a9b6e86f932e2013fbff2182a9ce9ccabda4f325a5 BUNDLED WITH - 4.0.0.beta1 + 4.0.0.beta2 diff --git a/tool/bundler/standard_gems.rb.lock b/tool/bundler/standard_gems.rb.lock index 8f4eba83c51b5a..20b7d153929917 100644 --- a/tool/bundler/standard_gems.rb.lock +++ b/tool/bundler/standard_gems.rb.lock @@ -176,4 +176,4 @@ CHECKSUMS unicode-emoji (4.1.0) sha256=4997d2d5df1ed4252f4830a9b6e86f932e2013fbff2182a9ce9ccabda4f325a5 BUNDLED WITH - 4.0.0.beta1 + 4.0.0.beta2 diff --git a/tool/bundler/test_gems.rb.lock b/tool/bundler/test_gems.rb.lock index 8c8c9b77436542..44a2cdcd969d3c 100644 --- a/tool/bundler/test_gems.rb.lock +++ b/tool/bundler/test_gems.rb.lock @@ -100,4 +100,4 @@ CHECKSUMS tilt (2.6.1) sha256=35a99bba2adf7c1e362f5b48f9b581cce4edfba98117e34696dde6d308d84770 BUNDLED WITH - 4.0.0.beta1 + 4.0.0.beta2 From 61f34568037f0948491bf8bf2b00c6c39ee3537b Mon Sep 17 00:00:00 2001 From: git Date: Wed, 26 Nov 2025 07:03:09 +0000 Subject: [PATCH 3/6] Update default gems list at ecdeb90fe94af86c6d84fe343c1f95 [ci skip] --- NEWS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index fbbc06713438cd..fa588780955227 100644 --- a/NEWS.md +++ b/NEWS.md @@ -186,8 +186,8 @@ The following default gem is added. The following default gems are updated. -* RubyGems 4.0.0.beta1 -* bundler 4.0.0.beta1 +* RubyGems 4.0.0.beta2 +* bundler 4.0.0.beta2 * date 3.5.0 * digest 3.2.1 * english 0.8.1 From c85eb2d0d05d2175018b3e0e544f1d87da029ee7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 26 Nov 2025 18:40:10 +0900 Subject: [PATCH 4/6] [ruby/timeout] Revert "Suppress warnings in two tests" This reverts commit https://github.com/ruby/timeout/commit/983cbf636a17, that is fixed by test-unit 3.7.3. https://github.com/ruby/timeout/commit/095207f270 --- test/test_timeout.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_timeout.rb b/test/test_timeout.rb index 71d8e1f5c273c5..01156867b05609 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -250,7 +250,7 @@ def test_fork end def test_threadgroup - assert_separately(%w[-W0 -rtimeout], <<-'end;') + assert_separately(%w[-rtimeout], <<-'end;') tg = ThreadGroup.new thr = Thread.new do tg.add(Thread.current) @@ -263,7 +263,7 @@ def test_threadgroup # https://github.com/ruby/timeout/issues/24 def test_handling_enclosed_threadgroup - assert_separately(%w[-W0 -rtimeout], <<-'end;') + assert_separately(%w[-rtimeout], <<-'end;') Thread.new { t = Thread.current group = ThreadGroup.new From 6ace0251ef47e669994adf268cbf4362c292bab0 Mon Sep 17 00:00:00 2001 From: Sam Westerman Date: Tue, 25 Nov 2025 17:50:49 -0800 Subject: [PATCH 5/6] [ruby/optparse] Put `private` before method declarations https://github.com/ruby/optparse/commit/5478354d4f --- lib/optparse.rb | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/lib/optparse.rb b/lib/optparse.rb index c66c84270a1517..4140b5f0743cc2 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -562,7 +562,7 @@ def initialize(pattern = nil, conv = nil, # Parses +arg+ and returns rest of +arg+ and matched portion to the # argument pattern. Yields when the pattern doesn't match substring. # - def parse_arg(arg) # :nodoc: + private def parse_arg(arg) # :nodoc: pattern or return nil, [arg] unless m = pattern.match(arg) yield(InvalidArgument, arg) @@ -580,14 +580,13 @@ def parse_arg(arg) # :nodoc: yield(InvalidArgument, arg) # didn't match whole arg return arg[s.length..-1], m end - private :parse_arg # # Parses argument, converts and returns +arg+, +block+ and result of # conversion. Yields at semi-error condition instead of raising an # exception. # - def conv_arg(arg, val = []) # :nodoc: + private def conv_arg(arg, val = []) # :nodoc: v, = *val if conv val = conv.call(*val) @@ -599,7 +598,6 @@ def conv_arg(arg, val = []) # :nodoc: end return arg, block, val end - private :conv_arg # # Produces the summary text. Each line of the summary is yielded to the @@ -883,14 +881,13 @@ def reject(t) # +lopts+:: Long style option list. # +nlopts+:: Negated long style options list. # - def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc: + private def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc: sopts.each {|o| @short[o] = sw} if sopts lopts.each {|o| @long[o] = sw} if lopts nlopts.each {|o| @long[o] = nsw} if nsw and nlopts used = @short.invert.update(@long.invert) @list.delete_if {|o| Switch === o and !used[o]} end - private :update # # Inserts +switch+ at the head of the list, and associates short, long @@ -1459,14 +1456,13 @@ def to_a; summarize("#{banner}".split(/^/)) end # +prv+:: Previously specified argument. # +msg+:: Exception message. # - def notwice(obj, prv, msg) # :nodoc: + private def notwice(obj, prv, msg) # :nodoc: unless !prv or prv == obj raise(ArgumentError, "argument #{msg} given twice: #{obj}", ParseError.filter_backtrace(caller(2))) end obj end - private :notwice SPLAT_PROC = proc {|*a| a.length <= 1 ? a.first : a} # :nodoc: @@ -1733,7 +1729,7 @@ def order!(argv = default_argv, into: nil, **keywords, &nonopt) parse_in_order(argv, setter, **keywords, &nonopt) end - def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **, &nonopt) # :nodoc: + private def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **, &nonopt) # :nodoc: opt, arg, val, rest = nil nonopt ||= proc {|a| throw :terminate, a} argv.unshift(arg) if arg = catch(:terminate) { @@ -1824,10 +1820,9 @@ def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **, argv end - private :parse_in_order # Calls callback with _val_. - def callback!(cb, max_arity, *args) # :nodoc: + private def callback!(cb, max_arity, *args) # :nodoc: args.compact! if (size = args.size) < max_arity and cb.to_proc.lambda? @@ -1837,7 +1832,6 @@ def callback!(cb, max_arity, *args) # :nodoc: end cb.call(*args) end - private :callback! # # Parses command line arguments +argv+ in permutation mode and returns @@ -1951,24 +1945,22 @@ def self.getopts(*args, symbolize_names: false) # Traverses @stack, sending each element method +id+ with +args+ and # +block+. # - def visit(id, *args, &block) # :nodoc: + private def visit(id, *args, &block) # :nodoc: @stack.reverse_each do |el| el.__send__(id, *args, &block) end nil end - private :visit # # Searches +key+ in @stack for +id+ hash and returns or yields the result. # - def search(id, key) # :nodoc: + private def search(id, key) # :nodoc: block_given = block_given? visit(:search, id, key) do |k| return block_given ? yield(k) : k end end - private :search # # Completes shortened long style option switch and returns pair of @@ -1979,7 +1971,7 @@ def search(id, key) # :nodoc: # +icase+:: Search case insensitive if true. # +pat+:: Optional pattern for completion. # - def complete(typ, opt, icase = false, *pat) # :nodoc: + private def complete(typ, opt, icase = false, *pat) # :nodoc: if pat.empty? search(typ, opt) {|sw| return [sw, opt]} # exact match or... end @@ -1989,7 +1981,6 @@ def complete(typ, opt, icase = false, *pat) # :nodoc: exc = ambiguous ? AmbiguousOption : InvalidOption raise exc.new(opt, additional: proc {|o| additional_message(typ, o)}) end - private :complete # # Returns additional info. From 38022961ae399015c542c409948aa4885e8e56e0 Mon Sep 17 00:00:00 2001 From: Sam Westerman Date: Tue, 25 Nov 2025 18:26:06 -0800 Subject: [PATCH 6/6] [ruby/optparse] Remove unneeded `public` Removed public visibility from the candidate method. https://github.com/ruby/optparse/commit/9a784a89a2 --- lib/optparse.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/optparse.rb b/lib/optparse.rb index 4140b5f0743cc2..e0b0ff011b5455 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -472,7 +472,6 @@ def candidate(key, icase = false, pat = nil, &_) Completion.candidate(key, icase, pat, &method(:each)) end - public def complete(key, icase = false, pat = nil) candidates = candidate(key, icase, pat, &method(:each)).sort_by {|k, v, kn| kn.size} if candidates.size == 1