From 912cf819b96a7ada89db044add26e94746f3ebb5 Mon Sep 17 00:00:00 2001 From: Augustin Gottlieb <33221555+aguspe@users.noreply.github.com> Date: Fri, 2 Jan 2026 17:54:42 +0100 Subject: [PATCH 1/2] [ruby/openssl] Improve Argument Error Message in EC:Group.new Before, passing the wrong number of arguments (e.g., 2) to OpenSSL::PKey::EC::Group.new raised a generic "wrong number of arguments" error. This change updates it to show the actual argument count and the expected options (1 or 4), making debugging easier for the user. Example: ArgumentError: wrong number of arguments (given 2, expected 1 or 4) I hope it helps! https://github.com/ruby/openssl/commit/783c99e6c7 --- ext/openssl/ossl_pkey_ec.c | 2 +- test/openssl/test_pkey_ec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c index bb19533edf4744..35f031819dc6eb 100644 --- a/ext/openssl/ossl_pkey_ec.c +++ b/ext/openssl/ossl_pkey_ec.c @@ -702,7 +702,7 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self) break; default: - ossl_raise(rb_eArgError, "wrong number of arguments"); + ossl_raise(rb_eArgError, "wrong number of arguments (given %d, expected 1 or 4)", argc); } ASSUME(group); diff --git a/test/openssl/test_pkey_ec.rb b/test/openssl/test_pkey_ec.rb index 88085bc68c7ef5..ec97a747a33b8b 100644 --- a/test/openssl/test_pkey_ec.rb +++ b/test/openssl/test_pkey_ec.rb @@ -345,6 +345,15 @@ def test_ec_group assert_equal group1.degree, group4.degree end + def test_ec_group_initialize_error_message + # Test that passing 2 arguments raises the helpful error + e = assert_raise(ArgumentError) do + OpenSSL::PKey::EC::Group.new(:GFp, 123) + end + + assert_equal("wrong number of arguments (given 2, expected 1 or 4)", e.message) + end + def test_ec_point group = OpenSSL::PKey::EC::Group.new("prime256v1") key = OpenSSL::PKey::EC.generate(group) From 18672b392b7164c783381979ad34d550955d0416 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 4 Jan 2026 16:00:23 +0900 Subject: [PATCH 2/2] [DOC] Add `base-url` to ChangeLog by default It is used to expand repository references to URL. --- tool/lib/vcs.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 602f6dd519c5b3..4f6dc0043283e8 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -453,7 +453,7 @@ def branch_beginning(url) #{url.to_str} -- version.h include/ruby/version.h]) end - def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, base_url: nil) + def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, base_url: true) from, to = [from, to].map do |rev| rev or next rev unless rev.empty? @@ -476,6 +476,7 @@ def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, arg = ["--since=25 Dec 00:00:00", to] end if base_url == true + env = CHANGELOG_ENV remote, = upstream if remote &&= cmd_read(env, %W[#{COMMAND} remote get-url --no-push #{remote}]) remote.chomp! @@ -494,9 +495,10 @@ def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, end LOG_FIX_REGEXP_SEPARATORS = '/!:;|,#%&' + CHANGELOG_ENV = {'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'} def changelog_formatter(path, arg, base_url = nil) - env = {'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'} + env = CHANGELOG_ENV cmd = %W[#{COMMAND} log --format=fuller --notes=commits --notes=log-fix --topo-order --no-merges --fixed-strings --invert-grep --grep=[ci\ skip] --grep=[skip\ ci]