diff --git a/dev-ruby/haml/files/haml-6.3.0-ruby34-backtrace.patch b/dev-ruby/haml/files/haml-6.3.0-ruby34-backtrace.patch new file mode 100644 index 0000000000000..b70ad956dd6f3 --- /dev/null +++ b/dev-ruby/haml/files/haml-6.3.0-ruby34-backtrace.patch @@ -0,0 +1,27 @@ +From 4f36be66d080cc57433ae2dbd13984e8361dec4b Mon Sep 17 00:00:00 2001 +From: Akira Matsuda +Date: Mon, 19 Aug 2024 04:00:31 +0900 +Subject: [PATCH] Backtrace format has been changed since Ruby 3.4 + +Method names are quoted with '' +https://bugs.ruby-lang.org/issues/16495 + +Method names include method owner +https://bugs.ruby-lang.org/issues/19117 +--- + test/haml/engine_test.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/haml/engine_test.rb b/test/haml/engine_test.rb +index f0fe006d7..6cebd913e 100644 +--- a/test/haml/engine_test.rb ++++ b/test/haml/engine_test.rb +@@ -97,7 +97,7 @@ def use_test_tracing(options) + unless options[:filename] + # use caller method name as fake filename. useful for debugging + i = -1 +- caller[i+=1] =~ /`(.+?)'/ until $1 and $1.index('test_') == 0 ++ caller[i+=1] =~ /[`'](?:.+?#)?(.+?)'/ until $1 and $1.index('test_') == 0 + options[:filename] = "(#{$1})" + end + options diff --git a/dev-ruby/haml/files/haml-6.3.0-ruby34.patch b/dev-ruby/haml/files/haml-6.3.0-ruby34.patch new file mode 100644 index 0000000000000..2f2878cb453ef --- /dev/null +++ b/dev-ruby/haml/files/haml-6.3.0-ruby34.patch @@ -0,0 +1,57 @@ +From a08d5cd792555621d8e778e4d71db5e88b7292c0 Mon Sep 17 00:00:00 2001 +From: Geremia Taglialatela +Date: Sat, 28 Dec 2024 10:27:55 +0100 +Subject: [PATCH] Test against 3.4 and fix tests for `Hash#inspect` + +Ref: ruby/ruby@a8a0591 + +Close #1173 +--- + .github/workflows/test.yml | 1 + + test/haml/engine/old_attribute_test.rb | 2 +- + test/haml/engine/text_test.rb | 2 +- + test/test_helper.rb | 5 +++++ + 4 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/test/haml/engine/old_attribute_test.rb b/test/haml/engine/old_attribute_test.rb +index c03740341..7570aefce 100644 +--- a/test/haml/engine/old_attribute_test.rb ++++ b/test/haml/engine/old_attribute_test.rb +@@ -182,7 +182,7 @@ + + it 'does not join others' do + assert_render(<<-HTML.unindent, <<-HAML.unindent) +- ++ + HTML + %a{ data: { value: [count: 1] } } + HAML +diff --git a/test/haml/engine/text_test.rb b/test/haml/engine/text_test.rb +index f72e76cd0..cec239ee8 100644 +--- a/test/haml/engine/text_test.rb ++++ b/test/haml/engine/text_test.rb +@@ -6,7 +6,7 @@ + skip 'escape is not working well in truffleruby' if RUBY_ENGINE == 'truffleruby' + assert_render(<<-HTML.unindent, <<-'HAML'.unindent) + a3aa" ["1", 2] b " ! +- a{:a=>3} ++ a#{render_hash({ a: 3 })} + + HTML + #{ "a#{3}a" }a" #{["1", 2]} b " ! +diff --git a/test/test_helper.rb b/test/test_helper.rb +index 8a94f3578..40d89bbd4 100644 +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -46,6 +46,11 @@ def assert_haml(haml, options = {}) + actual = render_haml(haml, options) + assert_equal expected, actual + end ++ ++ # See haml/haml#1173 and ruby/ruby@a8a0591 ++ def render_hash(hash) ++ Haml::Util.escape_html(hash) ++ end + end + + class Haml::TestCase < BASE_TEST_CLASS diff --git a/dev-ruby/haml/haml-6.3.0-r1.ebuild b/dev-ruby/haml/haml-6.3.0-r1.ebuild index cf0916b76cc0e..4aa73c9cd239a 100644 --- a/dev-ruby/haml/haml-6.3.0-r1.ebuild +++ b/dev-ruby/haml/haml-6.3.0-r1.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby31 ruby32 ruby33" +USE_RUBY="ruby32 ruby33 ruby34" RUBY_FAKEGEM_BINWRAP="" @@ -23,6 +23,8 @@ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~ IUSE="doc test" +PATCHES=( "${FILESDIR}/${P}-ruby34-backtrace.patch" "${FILESDIR}/${P}-ruby34.patch" ) + ruby_add_rdepend ">=dev-ruby/temple-0.8.2 dev-ruby/thor dev-ruby/tilt:*" ruby_add_bdepend "