dev-util/cucumber: cleanup
[gentoo.git] / dev-util / cucumber / cucumber-1.3.20-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 USE_RUBY="ruby20 ruby21 ruby22"
6
7 # Documentation task depends on sdoc which we currently don't have.
8 RUBY_FAKEGEM_TASK_DOC=""
9 RUBY_FAKEGEM_TASK_TEST="none"
10 RUBY_FAKEGEM_EXTRADOC="History.md README.md"
11
12 RUBY_FAKEGEM_GEMSPEC="cucumber.gemspec"
13
14 inherit ruby-fakegem
15
16 DESCRIPTION="Executable feature scenarios"
17 HOMEPAGE="https://github.com/aslakhellesoy/cucumber/wikis"
18 LICENSE="Ruby"
19
20 KEYWORDS="alpha amd64 arm hppa ~ia64 ppc ppc64 sparc x86"
21 SLOT="0"
22 IUSE="examples test"
23
24 ruby_add_bdepend "
25         test? (
26                 >=dev-ruby/rspec-2.13.0
27                 >=dev-ruby/nokogiri-1.5.2
28                 >=dev-ruby/syntax-1.0.0
29                 >=dev-util/aruba-0.5.2
30                 >=dev-ruby/json-1.7
31                 dev-ruby/bundler
32                 >=dev-util/cucumber-1.3
33         )"
34
35 ruby_add_rdepend "
36         >=dev-ruby/builder-2.1.2:*
37         >=dev-ruby/diff-lcs-1.1.3
38         >=dev-ruby/gherkin-2.12.0:0
39         >=dev-ruby/multi_json-1.7.5
40         >=dev-ruby/multi_test-0.1.2
41 "
42
43 all_ruby_prepare() {
44         # Remove development dependencies from the gemspec that we don't
45         # need or can't satisfy.
46         sed -i -e '/\(spork\|simplecov\|bcat\|kramdown\|yard\|capybara\|rack-test\|ramaze\|sinatra\|webrat\|mime-types\|rubyzip\)/d' ${RUBY_FAKEGEM_GEMSPEC} || die
47
48         # Fix too-strict test dependencies
49         sed -e '/nokogiri/ s/~> 1.5.2/>= 1.5.2/' \
50                 -e '/aruba/ s/= 0.5.2/~> 0.5/' \
51                 -e '/rake/ s/10.2/13/' -i ${RUBY_FAKEGEM_GEMSPEC} || die
52
53         # Make sure spork is run in the right interpreter
54         sed -i -e 's/#{Spork::BINARY}/-S #{Spork::BINARY}/' features/support/env.rb || die
55         rm features/drb_server_integration.feature || die
56
57         # Avoid json, they most likely fail due to multi_json weirdness.
58         rm features/json_formatter.feature || die
59         # Avoid features that break with newer rspec versions.
60         sed -i -e '369,398d' features/background.feature || die
61
62         # Avoid dependency on git
63         sed -i -e 's/git ls-files/find/' cucumber.gemspec || die
64 }
65
66 each_ruby_test() {
67         ruby-ng_rspec
68         RUBYLIB=lib ${RUBY} -Ilib bin/cucumber features || die "Features failed"
69 }
70
71 all_ruby_install() {
72         all_fakegem_install
73
74         if use examples; then
75                 cp -pPR examples "${D}/usr/share/doc/${PF}" || die "Failed installing example files."
76         fi
77 }