From e5b2e5227b4ebf0a0635126e0fb335f8f607bc96 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 7 Oct 2025 10:30:28 +0200 Subject: [PATCH 1/3] [ruby/json] Release 2.15.1 https://github.com/ruby/json/commit/9e6067bb55 --- ext/json/lib/json/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/json/lib/json/version.rb b/ext/json/lib/json/version.rb index e2db923e309cac..be5daf4c5b6902 100644 --- a/ext/json/lib/json/version.rb +++ b/ext/json/lib/json/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JSON - VERSION = '2.15.0' + VERSION = '2.15.1' end From 71e231847b8728db109f65b673818e14f691c517 Mon Sep 17 00:00:00 2001 From: git Date: Tue, 7 Oct 2025 08:35:07 +0000 Subject: [PATCH 2/3] Update default gems list at e5b2e5227b4ebf0a0635126e0fb335 [ci skip] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 6c9de939704722..9639c2908a81f2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -188,7 +188,7 @@ The following default gems are updated. * io-console 0.8.1 * io-nonblock 0.3.2 * io-wait 0.3.2 -* json 2.15.0 +* json 2.15.1 * openssl 4.0.0.pre * optparse 0.7.0.dev.2 * pp 0.6.3 From c693b0e4771915127c8e097ae2d84dea53c2b339 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Tue, 7 Oct 2025 18:01:02 +0900 Subject: [PATCH 3/3] [ruby/error_highlight] Improve English comments and messages https://github.com/ruby/error_highlight/commit/5f976265ef --- lib/error_highlight/base.rb | 9 ++++----- lib/error_highlight/core_ext.rb | 2 +- lib/error_highlight/formatter.rb | 4 ++-- test/error_highlight/test_error_highlight.rb | 14 +++++++------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/error_highlight/base.rb b/lib/error_highlight/base.rb index a4c65c63e687fd..22e0bf0dc39738 100644 --- a/lib/error_highlight/base.rb +++ b/lib/error_highlight/base.rb @@ -1,13 +1,13 @@ require_relative "version" module ErrorHighlight - # Identify the code fragment at that a given exception occurred. + # Identify the code fragment where a given exception occurred. # # Options: # # point_type: :name | :args - # :name (default) points the method/variable name that the exception occurred. - # :args points the arguments of the method call that the exception occurred. + # :name (default) points to the method/variable name where the exception occurred. + # :args points to the arguments of the method call where the exception occurred. # # backtrace_location: Thread::Backtrace::Location # It locates the code fragment of the given backtrace_location. @@ -113,7 +113,7 @@ def initialize(node, point_type: :name, name: nil) snippet = @node.script_lines[lineno - 1 .. last_lineno - 1].join("") snippet += "\n" unless snippet.end_with?("\n") - # It require some work to support Unicode (or multibyte) characters. + # It requires some work to support Unicode (or multibyte) characters. # Tentatively, we stop highlighting if the code snippet has non-ascii characters. # See https://github.com/ruby/error_highlight/issues/4 raise NonAscii unless snippet.ascii_only? @@ -504,7 +504,6 @@ def spot_fcall_for_name def spot_fcall_for_args _mid, nd_args = @node.children if nd_args && nd_args.first_lineno == nd_args.last_lineno - # binary operator fetch_line(nd_args.first_lineno) @beg_column = nd_args.first_column @end_column = nd_args.last_column diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb index 2fb07f2e65bc7c..d4f91e118567bc 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 create a snippet of the method definition; use Ruby 3.5 or later)" + out += "\n (cannot highlight method definition; try Ruby 3.5 or later)" end end ret << "\n" + out if out diff --git a/lib/error_highlight/formatter.rb b/lib/error_highlight/formatter.rb index 5180576405b17d..d2fad9e75c747d 100644 --- a/lib/error_highlight/formatter.rb +++ b/lib/error_highlight/formatter.rb @@ -56,11 +56,11 @@ def self.max_snippet_width=(width) end def self.terminal_width - # lazy load io/console, so it's not loaded when 'max_snippet_width' is set + # lazy load io/console to avoid loading it when 'max_snippet_width' is manually set require "io/console" $stderr.winsize[1] if $stderr.tty? rescue LoadError, NoMethodError, SystemCallError - # do not truncate when window size is not available + # skip truncation when terminal window size is unavailable end end diff --git a/test/error_highlight/test_error_highlight.rb b/test/error_highlight/test_error_highlight.rb index be3e3607332ca4..208dea8ea97128 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 create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END @@ -1494,7 +1494,7 @@ def test_missing_keyword MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END @@ -1515,7 +1515,7 @@ def test_unknown_keyword MethodDefLocationSupported ? "| def keyword_test(kw1:, kw2:, kw3:) ^^^^^^^^^^^^" : - "(cannot create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END @@ -1545,7 +1545,7 @@ def test_wrong_number_of_arguments_for_method2 MethodDefLocationSupported ? "| def wrong_number_of_arguments_test2( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" : - "(cannot create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END @@ -1567,7 +1567,7 @@ def test_wrong_number_of_arguments_for_lambda_literal MethodDefLocationSupported ? "| v = -> {} ^^" : - "(cannot create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END @@ -1589,7 +1589,7 @@ def test_wrong_number_of_arguments_for_lambda_method MethodDefLocationSupported ? "| v = lambda { } ^" : - "(cannot create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END @@ -1615,7 +1615,7 @@ def test_wrong_number_of_arguments_for_define_method MethodDefLocationSupported ? "| define_method :define_method_test do |x, y| ^^" : - "(cannot create a snippet of the method definition; use Ruby 3.5 or later)" + "(cannot highlight method definition; try Ruby 3.5 or later)" } END