public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-ruby/capybara/, dev-ruby/capybara/files/
@ 2025-05-29  8:11 Hans de Graaff
  0 siblings, 0 replies; only message in thread
From: Hans de Graaff @ 2025-05-29  8:11 UTC (permalink / raw
  To: gentoo-commits

commit:     c1cc13a4fda3cc86f1ed4a872c8c0123fcdaba13
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Thu May 29 08:10:38 2025 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Thu May 29 08:11:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1cc13a4

dev-ruby/capybara: fix compatibility with sinatra 4.1.0, add ruby34

Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-ruby/capybara/capybara-3.40.0-r1.ebuild        | 64 ++++++++++++++++++++++
 .../capybara/files/capybara-3.40.0-sinatra.patch   | 13 +++++
 2 files changed, 77 insertions(+)

diff --git a/dev-ruby/capybara/capybara-3.40.0-r1.ebuild b/dev-ruby/capybara/capybara-3.40.0-r1.ebuild
new file mode 100644
index 000000000000..1950e3cf92ef
--- /dev/null
+++ b/dev-ruby/capybara/capybara-3.40.0-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby32 ruby33 ruby34"
+
+RUBY_FAKEGEM_EXTRADOC="History.md README.md"
+
+# Rake tasks are not distributed in the gem.
+RUBY_FAKEGEM_TASK_TEST=""
+
+inherit virtualx ruby-fakegem
+
+DESCRIPTION="Capybara aims to simplify the process of integration testing Rack applications"
+HOMEPAGE="https://github.com/teamcapybara/capybara"
+LICENSE="MIT"
+
+SLOT="$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="test"
+
+DEPEND="${DEPEND} test? ( || ( www-client/firefox www-client/firefox-bin ) )"
+
+PATCHES=( "${FILESDIR}/${P}-sinatra.patch" )
+
+ruby_add_bdepend "test? (
+	dev-ruby/rspec:3
+	>=dev-ruby/launchy-2.4.0
+	>=dev-ruby/selenium-webdriver-4.8:4
+	dev-ruby/sinatra:4
+	www-servers/puma
+)"
+
+ruby_add_rdepend "
+	dev-ruby/addressable
+	dev-ruby/matrix
+	>=dev-ruby/mini_mime-0.1.3
+	>=dev-ruby/nokogiri-1.11:0
+	>=dev-ruby/rack-1.6.0:*
+	>=dev-ruby/rack-test-0.6.3:*
+	dev-ruby/regexp_parser:2
+	>=dev-ruby/xpath-3.2:3"
+
+all_ruby_prepare() {
+	sed -i -e '/bundler/d' -e '/pry/d' -e '2igem "sinatra", "~> 4.0"' -e '/statistics/Id' spec/spec_helper.rb || die
+
+	# Avoid window-manager specific tests (sizes are specific for fluxbox)
+	sed -i -e '/#maximize/,/^  end/ s:^:#:' lib/capybara/spec/session/window/window_spec.rb || die
+
+	# Avoid spec that requires unpackaged geckodriver
+	#sed -i -e '/describe.*register_server/,/^  end/ s:^:#:' spec/capybara_spec.rb || die
+
+	# Avoid test dependency on puma server for now
+	sed -i -e '/should have :puma registered/,/^    end/ s:^:#:' spec/capybara_spec.rb || die
+
+	# Update spec to catch the right error code. This seems to have
+	# changed recently across ruby versions.
+	sed -i -e '/raise_error/ s/EOFError/Net::ReadTimeout/' spec/server_spec.rb || die
+}
+
+each_ruby_test() {
+	virtx ${RUBY} -Ilib -S rspec-3 spec
+}

diff --git a/dev-ruby/capybara/files/capybara-3.40.0-sinatra.patch b/dev-ruby/capybara/files/capybara-3.40.0-sinatra.patch
new file mode 100644
index 000000000000..bb92799b6607
--- /dev/null
+++ b/dev-ruby/capybara/files/capybara-3.40.0-sinatra.patch
@@ -0,0 +1,13 @@
+Account for the new host_authorization setting introduced in Sinatra
+4.1.0.
+
+--- a/lib/capybara/spec/test_app.rb	2025-05-28 08:55:50.434344191 +0200
++++ b/lib/capybara/spec/test_app.rb	2025-05-29 09:00:09.004354200 +0200
+@@ -19,6 +19,7 @@
+   set :static, true
+   set :raise_errors, true
+   set :show_exceptions, false
++  set :host_authorization, { permitted_hosts: ['www.example.com', IPAddr.new('0.0.0.0/0')] }
+ 
+   # Also check lib/capybara/spec/views/*.erb for pages not listed here
+ 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-29  8:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29  8:11 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/capybara/, dev-ruby/capybara/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