dev-util/cucumber: remove unused patch.
[gentoo.git] / dev-util / cucumber / cucumber-2.4.0-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 USE_RUBY="ruby20 ruby21 ruby22 ruby23"
7
8 # Documentation task depends on sdoc which we currently don't have.
9 RUBY_FAKEGEM_TASK_DOC=""
10 RUBY_FAKEGEM_TASK_TEST="none"
11 RUBY_FAKEGEM_EXTRADOC="History.md README.md"
12
13 RUBY_FAKEGEM_GEMSPEC="cucumber.gemspec"
14
15 inherit ruby-fakegem
16
17 DESCRIPTION="Executable feature scenarios"
18 HOMEPAGE="https://github.com/aslakhellesoy/cucumber/wikis"
19 LICENSE="Ruby"
20
21 KEYWORDS="~amd64"
22 SLOT="0"
23 IUSE="examples test"
24
25 ruby_add_bdepend "
26         test? (
27                 dev-ruby/rspec:3
28                 >=dev-ruby/nokogiri-1.5.2
29                 >=dev-ruby/syntax-1.0.0
30                 >=dev-util/aruba-0.6.1 =dev-util/aruba-0.6*
31                 >=dev-ruby/json-1.7
32                 >=dev-util/cucumber-2
33                 >=dev-ruby/mime-types-2.99:2
34         )"
35
36 ruby_add_rdepend "
37         >=dev-ruby/builder-2.1.2:*
38         >=dev-util/cucumber-core-1.5.0:0
39         >=dev-util/cucumber-wire-0.0.1:0
40         >=dev-ruby/diff-lcs-1.1.3
41         >=dev-ruby/gherkin-4.0:4
42         >=dev-ruby/multi_json-1.7.5
43         >=dev-ruby/multi_test-0.1.2
44 "
45
46 all_ruby_prepare() {
47         # Remove development dependencies from the gemspec that we don't
48         # need or can't satisfy.
49         sed -i -e '/\(coveralls\|spork\|simplecov\|bcat\|kramdown\|yard\|capybara\|rack-test\|ramaze\|sinatra\|webrat\|mime-types\|rubyzip\)/d' ${RUBY_FAKEGEM_GEMSPEC} || die
50
51         # Avoid dependency on unpackaged cucumber-pro
52         sed -i -e '/cucumber-pro/ s:^:#:' Gemfile || die
53
54         # Avoid harmless failing spec
55         sed -i -e '/converts the snapshot path to a relative path/,/end/ s:^:#:' \
56                 spec/cucumber/formatter/html_spec.rb || die
57
58         # Avoid dependency on git
59         sed -i -e '/executables/ s/=.*/= ["cucumber"]/' \
60                 -e '/git ls-files/d' cucumber.gemspec || die
61
62 }
63
64 each_ruby_prepare() {
65         # Use the right interpreter
66         sed -i -e 's:ruby:'${RUBY}':' features/lib/step_definitions/ruby_steps.rb || die
67 }
68
69 each_ruby_test() {
70         RSPEC_VERSION=3 ruby-ng_rspec
71         CUCUMBER_USE_RELEASED_CORE=true PATH="${S}"/bin:${PATH} RUBYLIB="${S}"/lib ${RUBY} -Ilib bin/cucumber features || die "Features failed"
72 }
73
74 all_ruby_install() {
75         all_fakegem_install
76
77         if use examples; then
78                 cp -pPR examples "${D}/usr/share/doc/${PF}" || die "Failed installing example files."
79         fi
80 }