dev-util/bats: drop inactive proxy maintainer. By jstein
[gentoo.git] / dev-util / cucumber / cucumber-2.4.0-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 ruby23"
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="~amd64 ~arm ~arm64 ~ppc ~ppc64"
21 SLOT="0"
22 IUSE="examples test"
23
24 ruby_add_bdepend "
25         test? (
26                 dev-ruby/rspec:3
27                 >=dev-ruby/nokogiri-1.5.2
28                 >=dev-ruby/syntax-1.0.0
29                 >=dev-util/aruba-0.6.1 =dev-util/aruba-0.6*
30                 >=dev-ruby/json-1.7
31                 >=dev-util/cucumber-2
32                 >=dev-ruby/mime-types-2.99:2
33         )"
34
35 ruby_add_rdepend "
36         >=dev-ruby/builder-2.1.2:*
37         >=dev-util/cucumber-core-1.5.0:0
38         >=dev-util/cucumber-wire-0.0.1:0
39         >=dev-ruby/diff-lcs-1.1.3
40         >=dev-ruby/gherkin-4.0:4
41         >=dev-ruby/multi_json-1.7.5
42         >=dev-ruby/multi_test-0.1.2
43 "
44
45 all_ruby_prepare() {
46         # Remove development dependencies from the gemspec that we don't
47         # need or can't satisfy.
48         sed -i -e '/\(coveralls\|spork\|simplecov\|bcat\|kramdown\|yard\|capybara\|rack-test\|ramaze\|sinatra\|webrat\|mime-types\|rubyzip\)/d' ${RUBY_FAKEGEM_GEMSPEC} || die
49
50         # Avoid dependency on unpackaged cucumber-pro
51         sed -i -e '/cucumber-pro/ s:^:#:' Gemfile || die
52
53         # Avoid harmless failing spec
54         sed -i -e '/converts the snapshot path to a relative path/,/end/ s:^:#:' \
55                 spec/cucumber/formatter/html_spec.rb || die
56
57         # Avoid dependency on git
58         sed -i -e '/executables/ s/=.*/= ["cucumber"]/' \
59                 -e '/git ls-files/d' cucumber.gemspec || die
60
61 }
62
63 each_ruby_prepare() {
64         # Use the right interpreter
65         sed -i -e 's:ruby:'${RUBY}':' features/lib/step_definitions/ruby_steps.rb || die
66 }
67
68 each_ruby_test() {
69         RSPEC_VERSION=3 ruby-ng_rspec
70         CUCUMBER_USE_RELEASED_CORE=true PATH="${S}"/bin:${PATH} RUBYLIB="${S}"/lib ${RUBY} -Ilib bin/cucumber features || die "Features failed"
71 }
72
73 all_ruby_install() {
74         all_fakegem_install
75
76         if use examples; then
77                 cp -pPR examples "${D}/usr/share/doc/${PF}" || die "Failed installing example files."
78         fi
79 }