diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2016-11-09 00:14:04 +0100 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2016-11-09 00:14:04 +0100 |
commit | 340c3aec732de7f8f1bac0dce62aff2f74b1bb86 (patch) | |
tree | 99e1483715d48b1e3efdddc5656600a51003760c /dev-ruby/fakeweb | |
parent | sys-apps/tmpfiles: add live ebuild (diff) | |
download | gentoo-340c3aec732de7f8f1bac0dce62aff2f74b1bb86.tar.gz gentoo-340c3aec732de7f8f1bac0dce62aff2f74b1bb86.tar.bz2 gentoo-340c3aec732de7f8f1bac0dce62aff2f74b1bb86.zip |
dev-ruby/fakeweb: Add ruby23
Package-Manager: portage-2.3.2
Diffstat (limited to 'dev-ruby/fakeweb')
-rw-r--r-- | dev-ruby/fakeweb/fakeweb-1.3.0.20131201-r1.ebuild | 55 | ||||
-rw-r--r-- | dev-ruby/fakeweb/files/fakeweb-ruby23.patch | 27 |
2 files changed, 82 insertions, 0 deletions
diff --git a/dev-ruby/fakeweb/fakeweb-1.3.0.20131201-r1.ebuild b/dev-ruby/fakeweb/fakeweb-1.3.0.20131201-r1.ebuild new file mode 100644 index 000000000000..89668bef6047 --- /dev/null +++ b/dev-ruby/fakeweb/fakeweb-1.3.0.20131201-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +USE_RUBY="ruby20 ruby21 ruby22 ruby23" + +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 + fakeweb-ruby23.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-ruby23.patch b/dev-ruby/fakeweb/files/fakeweb-ruby23.patch new file mode 100644 index 000000000000..0a1c6db6b3e7 --- /dev/null +++ b/dev-ruby/fakeweb/files/fakeweb-ruby23.patch @@ -0,0 +1,27 @@ +From c42a354eda2f6bfe8dc7c1176e085dda6867f4d0 Mon Sep 17 00:00:00 2001 +From: Christian Hofstaedtler <christian@hofstaedtler.name> +Date: Thu, 3 Mar 2016 17:42:30 -0300 +Subject: [PATCH] Fix tests for ruby 2.3 (new connect_nonblock call) + +Applies on top of the changes for 2.2 (#53). +--- + test/test_helper.rb | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/test/test_helper.rb b/test/test_helper.rb +index e9a36af..8ce492d 100644 +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -119,7 +119,11 @@ def setup_expectations_for_real_request(options = {}) + OpenSSL::SSL::SSLSocket.expects(:===).with(socket).returns(true).at_least_once + OpenSSL::SSL::SSLSocket.expects(:new).with(socket, instance_of(OpenSSL::SSL::SSLContext)).returns(socket).at_least_once + socket.stubs(:sync_close=).returns(true) +- socket.expects(:connect).with().at_least_once ++ if RUBY_VERSION >= "2.3.0" ++ socket.expects(:connect_nonblock).with(:exception => false).at_least_once ++ else ++ socket.expects(:connect).with().at_least_once ++ end + if RUBY_VERSION >= "2.0.0" && RUBY_PLATFORM != "java" + socket.expects(:session).with().at_least_once + end |