summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2016-11-03 08:00:16 +0100
committerHans de Graaff <graaff@gentoo.org>2016-11-03 08:00:16 +0100
commit3ab474733f85f3620e9695b64042bdeab301b42d (patch)
treea4571c78b574ccf6480e258f9b59e3fcecbcd063 /dev-ruby/fakeweb
parentdev-ruby/sshkit: add 1.11.4 (diff)
downloadgentoo-3ab474733f85f3620e9695b64042bdeab301b42d.tar.gz
gentoo-3ab474733f85f3620e9695b64042bdeab301b42d.tar.bz2
gentoo-3ab474733f85f3620e9695b64042bdeab301b42d.zip
dev-ruby/fakeweb: add snapshot with ruby22 support
Package-Manager: portage-2.3.0
Diffstat (limited to 'dev-ruby/fakeweb')
-rw-r--r--dev-ruby/fakeweb/Manifest1
-rw-r--r--dev-ruby/fakeweb/fakeweb-1.3.0.20131201.ebuild54
-rw-r--r--dev-ruby/fakeweb/files/fakeweb-ruby22.patch24
3 files changed, 79 insertions, 0 deletions
diff --git a/dev-ruby/fakeweb/Manifest b/dev-ruby/fakeweb/Manifest
index cf291b78d4bb..d85007e3bdfe 100644
--- a/dev-ruby/fakeweb/Manifest
+++ b/dev-ruby/fakeweb/Manifest
@@ -1 +1,2 @@
+DIST fakeweb-1.3.0.20131201.tar.gz 60162 SHA256 44f599eb76b4996c53a3f047b3f37c72d93bac967893dcb1da18e5f8270b4f14 SHA512 f3bd40680b7eefe90d3fee67f5282dbe4c67d46a1f1040d0d0d62c978b69d08987581a53495bb56e32ebcc6679c84f03c2e26c51d2bd98daa80554d3424c6603 WHIRLPOOL 5cdb5faf3932614838fb9e1bb5f01a115c087af396df6bbecab421ea0d97f24377c06ab41f1919b339f76137d4c1ea1186a4269052163f0942cd9ee9ca1f8900
DIST fakeweb-1.3.0.gem 58368 SHA256 1ec996be13020a00b3464560c09180b424477c698f59f82edf2b99b16cfa09a8 SHA512 5785bf8e17f9b9b73a9fd2b581c6c5dcf466a5d68c2dbea593bca7cd5d385b5b1315ca777c39bce2a8077ccab6d5df7f031435c9227931c3d2a84512da9cb423 WHIRLPOOL 976e48b1e66e951a22fa28970356c3e85927027fd7262242a50ecac55771fc2ed7c1830d4dcc0566f479fa5c844a0d59b2b268ebd26ba87988f543b982e51214
diff --git a/dev-ruby/fakeweb/fakeweb-1.3.0.20131201.ebuild b/dev-ruby/fakeweb/fakeweb-1.3.0.20131201.ebuild
new file mode 100644
index 000000000000..f9aa352ccec1
--- /dev/null
+++ b/dev-ruby/fakeweb/fakeweb-1.3.0.20131201.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+USE_RUBY="ruby20 ruby21 ruby22"
+
+RUBY_FAKEGEM_RECIPE_DOC="rdoc"
+RUBY_FAKEGEM_EXTRADOC="CHANGELOG README.rdoc"
+
+COMMIT=48208f9bf053577befe5723746b6ff35b99b45d0
+
+inherit ruby-fakegem
+
+DESCRIPTION="Helper for faking web requests in Ruby"
+HOMEPAGE="https://github.com/chrisk/fakeweb"
+SRC_URI="https://github.com/chrisk/fakeweb/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+RUBY_S="${PN}-${COMMIT}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RUBY_PATCHES=( fakeweb-ruby22.patch )
+
+ruby_add_bdepend "
+ test? (
+ dev-ruby/mocha:0.14
+ dev-ruby/test-unit
+ )"
+
+all_ruby_prepare() {
+ # The package bundles samuel and right_http_connection, remove
+ # them
+ rm -r test/vendor || die "failed to remove bundled gems"
+
+ # We don't package sdoc and we don't have the direct template.
+ sed -i -e 's/sdoc/rdoc/' -e '/template/d' Rakefile || die
+
+ # Require an old enough version of mocha
+ sed -i -e '1igem "mocha", "~> 0.14.0"' test/test_helper.rb || die
+
+ # Use the test-unit gem to make jruby compatible with newer mocha.
+ sed -i -e '1igem "test-unit"' \
+ -e '/bundler/I s:^:#:' \
+ -e '/simplecov/ s:^:#:' test/test_helper.rb || die
+
+ # Avoid test dependencies on unmaintained packages that no longer work
+ rm test/test_other_net_http_libraries.rb || die
+
+ sed -i -e '/test:preflight/ s:^:#:' Rakefile || die
+}
diff --git a/dev-ruby/fakeweb/files/fakeweb-ruby22.patch b/dev-ruby/fakeweb/files/fakeweb-ruby22.patch
new file mode 100644
index 000000000000..7c44aef68922
--- /dev/null
+++ b/dev-ruby/fakeweb/files/fakeweb-ruby22.patch
@@ -0,0 +1,24 @@
+From 1647ca210691429a75eb159814f42e68c3c1ce4c Mon Sep 17 00:00:00 2001
+From: Josef Stribny <jstribny@redhat.com>
+Date: Thu, 19 Mar 2015 09:32:50 +0100
+Subject: [PATCH] Fix tests by expecting TypeError for Ruby 2.2
+
+---
+ test/test_fake_web.rb | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/test/test_fake_web.rb b/test/test_fake_web.rb
+index f344612..682c43d 100644
+--- a/test/test_fake_web.rb
++++ b/test/test_fake_web.rb
+@@ -35,7 +35,9 @@ def test_response_for_with_wrong_number_of_arguments
+ end
+
+ def test_register_uri_without_domain_name
+- assert_raises URI::InvalidURIError do
++ # Ruby 2.1 and lower raises URI::InvalidURIError
++ # Ruby 2.2 and higher raises TypeError
++ assert_raises URI::InvalidURIError, TypeError do
+ FakeWeb.register_uri(:get, 'test_example2.txt', fixture_path("test_example.txt"))
+ end
+ end