diff --git a/backport-Make-io-console-size-as-optional-dependency.patch b/backport-Make-io-console-size-as-optional-dependency.patch new file mode 100644 index 0000000000000000000000000000000000000000..62ea2adc27509bdf3c1cd9aa77e34b916b16b623 --- /dev/null +++ b/backport-Make-io-console-size-as-optional-dependency.patch @@ -0,0 +1,38 @@ +From 0b262057287952e4dbd5171bc958eaf709276b29 Mon Sep 17 00:00:00 2001 +From: Sutou Kouhei +Date: Tue, 11 Oct 2022 10:52:48 +0000 +Subject: [PATCH] Make `io/console/size` as optional dependency + +Because `io/console` family is unavailable on WebAssembly and WASI due +to missing termio APIs. +--- + .../gems/power_assert-2.0.1/lib/power_assert/inspector.rb | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/.bundle/gems/power_assert-2.0.1/lib/power_assert/inspector.rb b/.bundle/gems/power_assert-2.0.1/lib/power_assert/inspector.rb +index 50bb646..6a4d8b6 100644 +--- a/.bundle/gems/power_assert-2.0.1/lib/power_assert/inspector.rb ++++ b/.bundle/gems/power_assert-2.0.1/lib/power_assert/inspector.rb +@@ -1,5 +1,8 @@ + require 'power_assert/configuration' +-require 'io/console/size' ++begin ++ require 'io/console/size' ++rescue LoadError ++end + + module PowerAssert + class InspectedValue +@@ -44,7 +47,8 @@ module PowerAssert + def inspect + if PowerAssert.configuration.colorize_message + if PowerAssert.configuration.inspector == :pp +- width = [IO.console_size[1] - 1 - @indent, 10].max ++ console_width = IO.respond_to?(:console_size) ? IO.console_size[1] : 80 ++ width = [console_width - 1 - @indent, 10].max + IRB::ColorPrinter.pp(@value, '', width) + else + IRB::Color.colorize_code(@value.to_s, ignore_error: true) +-- +2.39.1 + diff --git a/ruby.spec b/ruby.spec index abfaaa9fd53a824ea1efba909ce55b3f8290c99b..7e88c752c06c90090d9f617a65813304b94c368f 100644 --- a/ruby.spec +++ b/ruby.spec @@ -30,7 +30,7 @@ Name: ruby Version: %{ruby_version} -Release: 132 +Release: 133 Summary: Object-oriented scripting language interpreter License: (Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD URL: https://www.ruby-lang.org/en/ @@ -88,6 +88,7 @@ Patch6007: backport-CVE-2019-16163.patch Patch6008: backport-Fix-test_cgi_cookie_new_with_domain-to-pass-on-older.patch Patch6009: backport-Loosen-the-domain-regex-to-accept-.-29.patch Patch6010: backport-irb-Drop-hard-dependency-on-RDoc.patch +Patch6011: backport-Make-io-console-size-as-optional-dependency.patch Provides: %{name}-libs = %{version}-%{release} Obsoletes: %{name}-libs < %{version}-%{release} @@ -884,6 +885,9 @@ make runruby TESTRUN_SCRIPT=%{SOURCE13} %{gem_dir}/specifications/matrix-%{matrix_version}.gemspec %changelog +* Mon Mar 20 2023 shixuantong - 3.1.3-133 +- Make 'io/console/size' as optional dependency + * Mon Mar 13 2023 shixuantong - 3.1.3-132 - ruby/irb Drop hard dependency on RDoc