summaryrefslogtreecommitdiff
blob: 83bf3f1aa1ab173c2b4bc974a09597cbe650ac7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

USE_RUBY="ruby22 ruby23 ruby24 ruby25"

RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="CHANGELOG README.rdoc"

COMMIT=2b08c1ff2714ec13a12f3497d67fcefce95c2cbe

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 ~hppa ~ppc ~ppc64 ~x86"
IUSE=""

ruby_add_bdepend "
	test? (
		dev-ruby/mocha
		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

	# 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
}