public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/rack-cache/files/, dev-ruby/rack-cache/
Date: Mon,  3 Apr 2023 03:03:43 +0000 (UTC)	[thread overview]
Message-ID: <1680490978.873608c1ca25d045b7068ab2a25063d920be3001.sam@gentoo> (raw)

commit:     873608c1ca25d045b7068ab2a25063d920be3001
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  3 02:35:10 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Apr  3 03:02:58 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=873608c1

dev-ruby/rack-cache: enable ruby32, fix tests, use modern mocha

- Enable ruby32
- Fix test failure which shows up for some folks (missing timeout require)
- Update mocha dep & patch mocha require accordingly (upstream patch)

Closes: https://bugs.gentoo.org/723920
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/rack-cache-1.13.0-mocha2.patch           | 20 +++++++++
 .../files/rack-cache-1.13.0-test-require.patch     | 28 ++++++++++++
 dev-ruby/rack-cache/rack-cache-1.13.0-r1.ebuild    | 51 ++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/dev-ruby/rack-cache/files/rack-cache-1.13.0-mocha2.patch b/dev-ruby/rack-cache/files/rack-cache-1.13.0-mocha2.patch
new file mode 100644
index 000000000000..62bd028eedf7
--- /dev/null
+++ b/dev-ruby/rack-cache/files/rack-cache-1.13.0-mocha2.patch
@@ -0,0 +1,20 @@
+https://github.com/rack/rack-cache/commit/8b22b6e532ed21ba30fdfbc62907f58db052e767
+
+From 8b22b6e532ed21ba30fdfbc62907f58db052e767 Mon Sep 17 00:00:00 2001
+From: Peter Goldstein <peter.m.goldstein@gmail.com>
+Date: Mon, 2 Jan 2023 06:32:20 -0500
+Subject: [PATCH] Adds Ruby 3.2 to the CI matrix (#12)
+
+* Update mocha require for modern version of mocha
+--- a/test/test_helper.rb
++++ b/test/test_helper.rb
+@@ -7,7 +7,7 @@
+ 
+ require 'maxitest/global_must'
+ require 'maxitest/autorun'
+-require 'mocha/setup'
++require 'mocha/minitest'
+ 
+ # Set the MEMCACHED environment variable as follows to enable testing
+ # of the MemCached meta and entity stores.
+

diff --git a/dev-ruby/rack-cache/files/rack-cache-1.13.0-test-require.patch b/dev-ruby/rack-cache/files/rack-cache-1.13.0-test-require.patch
new file mode 100644
index 000000000000..3d7d04deaa25
--- /dev/null
+++ b/dev-ruby/rack-cache/files/rack-cache-1.13.0-test-require.patch
@@ -0,0 +1,28 @@
+https://github.com/rack/rack-cache/pull/14
+
+From db34e2b5ab7b16051f7158b2896e56502992c33e Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 3 Apr 2023 03:31:31 +0100
+Subject: [PATCH] test: Add explicit 'timeout' require
+
+Fixes the following when running tests individually:
+```
+  1) Error:
+Rack::Cache::Context#test_0078_passes if there was a metastore exception:
+NameError: uninitialized constant Timeout
+    test/context_test.rb:981:in `block (3 levels) in <top (required)>'
+    test/test_helper.rb:170:in `request'
+    test/test_helper.rb:177:in `get'
+    test/context_test.rb:980:in `block (2 levels) in <top (required)>'
+```
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/test/context_test.rb
++++ b/test/context_test.rb
+@@ -1,4 +1,5 @@
+ require_relative 'test_helper'
++require 'timeout'
+ require 'rack/cache/context'
+ 
+ describe Rack::Cache::Context do
+

diff --git a/dev-ruby/rack-cache/rack-cache-1.13.0-r1.ebuild b/dev-ruby/rack-cache/rack-cache-1.13.0-r1.ebuild
new file mode 100644
index 000000000000..a816afabdb35
--- /dev/null
+++ b/dev-ruby/rack-cache/rack-cache-1.13.0-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+USE_RUBY="ruby27 ruby30 ruby31 ruby32"
+
+# no documentation is generable, it needs hanna, which is broken
+RUBY_FAKEGEM_RECIPE_DOC="none"
+
+RUBY_FAKEGEM_TASK_TEST="none"
+
+RUBY_FAKEGEM_EXTRADOC="CHANGES README.md doc/*"
+
+RUBY_FAKEGEM_GEMSPEC="rack-cache.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="Enable HTTP caching for Rack-based applications that produce freshness info"
+HOMEPAGE="https://github.com/rtomayko/rack-cache"
+SRC_URI="https://github.com/rtomayko/rack-cache/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="1.2"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+ruby_add_rdepend "dev-ruby/rack:*"
+
+ruby_add_bdepend "test? (
+	>=dev-ruby/maxitest-3.4.0
+	>=dev-ruby/minitest-5.7.0:5
+	>=dev-ruby/mocha-2 )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.13.0-test-require.patch
+	"${FILESDIR}"/${PN}-1.13.0-mocha2.patch
+)
+
+all_ruby_prepare() {
+	sed -i -e '/bundler/ s:^:#:' \
+		test/test_helper.rb || die
+}
+
+all_ruby_prepare() {
+	sed -i -e 's/git ls-files/find/' ${RUBY_FAKEGEM_GEMSPEC} || die
+	sed -i -e '/bundler/ s:^:#:' test/test_helper.rb || die
+}
+
+each_ruby_test() {
+	${RUBY} -I.:lib:test -e 'Dir["test/*_test.rb"].each{|f| require f}' || die
+}


                 reply	other threads:[~2023-04-03  3:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1680490978.873608c1ca25d045b7068ab2a25063d920be3001.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox