1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 USE_RUBY="ruby19 ruby20 ruby21 ruby22"
8 RUBY_FAKEGEM_TASK_DOC=""
9 RUBY_FAKEGEM_TASK_TEST=""
11 RUBY_FAKEGEM_DOCDIR="rdoc"
12 RUBY_FAKEGEM_EXTRADOC="History.md README.md"
16 DESCRIPTION="Fast Gherkin lexer and parser based on Ragel"
17 HOMEPAGE="https://github.com/cucumber/gherkin"
19 SRC_URI="https://github.com/cucumber/gherkin/archive/v${PV}.tar.gz -> ${P}-git.tgz"
21 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc64 ~x86"
25 DEPEND="${DEPEND} dev-util/ragel"
29 dev-ruby/rake-compiler
30 dev-ruby/ruby-beautify
32 >=dev-ruby/builder-2.1.2
33 >=dev-util/cucumber-1.1.3
34 >=dev-ruby/rspec-2.6.0
35 >=dev-ruby/term-ansicolor-1.0.5
37 doc? ( >=dev-ruby/yard-0.8.3 )"
39 ruby_add_rdepend ">=dev-ruby/multi_json-1.3"
41 RUBY_PATCHES=( ${P}-ruby21.patch )
44 # Remove Bundler-related things.
45 sed -i -e '/[Bb]undler/d' Rakefile spec/spec_helper.rb features/support/env.rb || die
48 # Don't use compile dependencies to avoid building again for specs.
49 sed -i -e '/:compile/d' Rakefile
51 # Keep this hardcoded -O0 optimization level since
52 # https://github.com/cucumber/gherkin/issues/182#issuecomment-6945009
53 # hints at the fact that removing it might cause the mysterious
54 # Lexer errors that hapen intermittently.
55 # sed -ie -e 's/-O0//' tasks/compile.rake || die
57 # Remove feature that depends on direct access to the cucumber
58 # source. We could probably set this up by downloading the source
59 # and unpacking it, but skipping this now in the interest of time.
60 rm features/pretty_formatter.feature || die
62 # We need to remove these tasks during bootstrapping since it tries
63 # to load cucumber already but we can be sure it isn't installed
64 # yet. Also remove other rake tasks for which we may not yet have
67 rm tasks/cucumber.rake tasks/rspec.rake || die "Unable to remove rake tasks."
70 # Avoid dependency on yard if USE=-doc
72 rm tasks/apidoc.rake || die
75 # Avoid implicit dependency on git
76 sed -i -e 's/git ls-files/echo/' gherkin.gemspec || die
88 ${RUBY} -I lib -S rake -rrake/clean -f tasks/compile.rake compile || die
92 ${RUBY} -I lib -S rspec-2 spec || die "Specs failed"
93 CUCUMBER_HOME="${HOME}" RUBYLIB=lib ${RUBY} -S cucumber features || die "Cucumber features failed"