* [gentoo-commits] repo/gentoo:master commit in: dev-ruby/globalid/, dev-ruby/globalid/files/
@ 2025-06-29 11:18 Hans de Graaff
0 siblings, 0 replies; only message in thread
From: Hans de Graaff @ 2025-06-29 11:18 UTC (permalink / raw
To: gentoo-commits
commit: 443971d881d87130d3492e29d32f1598dc1ce8c8
Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 29 09:56:32 2025 +0000
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Sun Jun 29 11:18:10 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=443971d8
dev-ruby/globalid: fix tests with new rails versions
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
.../globalid/files/globalid-1.2.1-ruby34.patch | 45 +++++++++++++++++++++
dev-ruby/globalid/globalid-1.2.1-r1.ebuild | 46 ++++++++++++++++++++++
2 files changed, 91 insertions(+)
diff --git a/dev-ruby/globalid/files/globalid-1.2.1-ruby34.patch b/dev-ruby/globalid/files/globalid-1.2.1-ruby34.patch
new file mode 100644
index 000000000000..57e46dd73dc3
--- /dev/null
+++ b/dev-ruby/globalid/files/globalid-1.2.1-ruby34.patch
@@ -0,0 +1,45 @@
+From d3075330a6be4d7a5013c2ebdd39e97678c3ac8d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Fri, 13 Dec 2024 13:36:55 +0100
+Subject: [PATCH] Keep using URI RFC2396 parser
+
+The default parser in URI 1.0.0 / Ruby 3.4 has been changed to RFC3986
+[[1]]. This causes test failures such as:
+
+~~~
+... snip ...
+
+Failure:
+GlobalIDTest#test_invalid_app_name [test/cases/global_id_test.rb:13]:
+ArgumentError expected but nothing was raised.
+
+rails test test/cases/global_id_test.rb:8
+
+F
+
+... snip ...
+~~~
+
+where underscores / ampersands are now allowed in host. Keep using URI
+RFC2396 parser for compatibility.
+
+Fixes #190
+
+[1]: https://github.com/ruby/uri/pull/107
+---
+ lib/global_id/uri/gid.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/global_id/uri/gid.rb b/lib/global_id/uri/gid.rb
+index 20a22a7..8af8feb 100644
+--- a/lib/global_id/uri/gid.rb
++++ b/lib/global_id/uri/gid.rb
+@@ -62,7 +62,7 @@ def validate_app(app)
+ # URI.parse('gid://bcx') # => URI::GID instance
+ # URI::GID.parse('gid://bcx/') # => raises URI::InvalidComponentError
+ def parse(uri)
+- generic_components = URI.split(uri) << nil << true # nil parser, true arg_check
++ generic_components = URI.split(uri) << URI::RFC2396_Parser.new << true # nil parser, true arg_check
+ new(*generic_components)
+ end
+
diff --git a/dev-ruby/globalid/globalid-1.2.1-r1.ebuild b/dev-ruby/globalid/globalid-1.2.1-r1.ebuild
new file mode 100644
index 000000000000..8c4129b0a78b
--- /dev/null
+++ b/dev-ruby/globalid/globalid-1.2.1-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby32 ruby33"
+
+RUBY_FAKEGEM_EXTRADOC="README.md"
+
+RUBY_FAKEGEM_GEMSPEC="globalid.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="Reference models by URI"
+HOMEPAGE="https://github.com/rails/globalid"
+SRC_URI="https://github.com/rails/globalid/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux"
+IUSE="test"
+
+PATCHES=( "${FILESDIR}/${P}-ruby34.patch" )
+
+ruby_add_bdepend "test? (
+ dev-ruby/bundler
+ <dev-ruby/activemodel-8.1
+ <dev-ruby/railties-8.1
+)"
+ruby_add_rdepend ">=dev-ruby/activesupport-6.1:*"
+
+all_ruby_prepare() {
+ rm -f Gemfile.lock || die
+
+ # Ensure a version of rails compatible with the tests.
+ sed -e '/^gem / s/$/, "<8.1"/' \
+ -i Gemfile || die
+
+ # Avoid the assumption that the cache format matches the rails version.
+ sed -e '/cache_format/ s/Rails::VERSION::STRING.to_f/7.1/' \
+ -i test/cases/railtie_test.rb || die
+
+ # Work around a bug in Rails: https://github.com/rails/rails/pull/55227
+ sed -e '3irequire "action_controller"' \
+ -i test/cases/railtie_test.rb || die
+}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-29 11:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-29 11:18 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/globalid/, dev-ruby/globalid/files/ Hans de Graaff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox