1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
USE_RUBY="ruby27 ruby30 ruby31"
|
|
6 |
USE_RUBY="ruby30 ruby31 ruby32"
|
7 |
7 |
|
|
8 |
RUBY_FAKEGEM_BINWRAP=""
|
8 |
9 |
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
|
9 |
10 |
RUBY_FAKEGEM_RECIPE_DOC="none"
|
10 |
11 |
|
... | ... | |
27 |
28 |
DEPEND+=" test? ( sys-process/lsof )"
|
28 |
29 |
|
29 |
30 |
ruby_add_rdepend "
|
30 |
|
dev-ruby/faraday-net_http:1
|
31 |
|
>=dev-ruby/multipart-post-1.2.0 <dev-ruby/multipart-post-3
|
32 |
|
dev-ruby/ruby2_keywords
|
|
31 |
|| ( =dev-ruby/faraday-net_http-3.0* dev-ruby/faraday-net_http:2 )
|
|
32 |
>=dev-ruby/ruby2_keywords-0.0.4
|
33 |
33 |
"
|
34 |
34 |
ruby_add_bdepend "test? (
|
35 |
35 |
>=dev-ruby/test-unit-2.4
|
36 |
36 |
>=dev-ruby/connection_pool-2.2.2
|
37 |
|
>=dev-ruby/httpclient-2.2
|
38 |
|
>=dev-ruby/net-http-persistent-3.0
|
39 |
|
>=dev-ruby/patron-0.4.2
|
40 |
|
dev-ruby/rack
|
41 |
|
>=dev-ruby/rack-test-0.6
|
|
37 |
dev-ruby/rack:2.2
|
42 |
38 |
dev-ruby/webmock
|
43 |
39 |
)"
|
44 |
40 |
|
... | ... | |
46 |
42 |
# Remove bundler support.
|
47 |
43 |
rm Gemfile || die
|
48 |
44 |
sed -i -e '/[Bb]undler/d ; 1irequire "yaml"' Rakefile || die
|
49 |
|
sed -i -e '/bundler/,/^fi/ s:^:#:' script/test || die
|
50 |
45 |
# Avoid loading all lib files since some of them require unpackaged dependencies.
|
51 |
46 |
sed -e '/[Cc]overall/ s:^:#:' \
|
52 |
47 |
-e '/lib\/\*\*/ s:^:#:' \
|
53 |
48 |
-e '/simplecov/ s:^:#:' \
|
54 |
49 |
-e '/SimpleCov/,/end/ s:^:#:' \
|
55 |
50 |
-e '/pry/ s:^:#:' \
|
|
51 |
-e '3igem "rack", "~> 2.2"' \
|
56 |
52 |
-i spec/spec_helper.rb || die
|
57 |
53 |
|
58 |
54 |
sed -e '/git ls-files/ s:^:#:' \
|
59 |
55 |
-e "s:_relative ': './:" \
|
60 |
56 |
-i ${RUBY_FAKEGEM_GEMSPEC} || die
|
61 |
|
|
62 |
|
# Avoid multipart tests that require an unpackaged dependency
|
63 |
|
# that appears to be no longer maintained.
|
64 |
|
rm -f spec/faraday/request/multipart_spec.rb || die
|
65 |
|
sed -e '/multipart_parser/ s:^:#:' \
|
66 |
|
-i spec/support/helper_methods.rb || die
|
67 |
|
|
68 |
|
# Remove specs for unpackaged adapters
|
69 |
|
rm -f spec/faraday/adapter/{em_http,em_synchrony,excon}_spec.rb || die
|
70 |
|
|
71 |
|
# Make this adapter optional since it comes with a long list of
|
72 |
|
# dependencies.
|
73 |
|
if ! has_version "dev-ruby/typhoeus:1" ; then
|
74 |
|
rm -f spec/faraday/adapter/typhoeus_spec.rb || die
|
75 |
|
fi
|
76 |
|
}
|
77 |
|
|
78 |
|
each_ruby_prepare() {
|
79 |
|
# Make sure the test scripts use the right ruby interpreter
|
80 |
|
sed -i -e 's:ruby:'${RUBY}':' script/* || die
|
81 |
57 |
}
|
82 |
58 |
|
83 |
59 |
each_ruby_test() {
|
84 |
60 |
MT_NO_PLUGINS=true each_fakegem_test
|
85 |
|
|
86 |
|
# Sleep some time to allow the sinatra test server to die
|
87 |
|
einfo "Waiting for test server to stop"
|
88 |
|
sleep 10
|
89 |
61 |
}
|