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_TEST="none"
9 RUBY_FAKEGEM_TASK_DOC="none"
11 RUBY_FAKEGEM_EXTRADOC="Changelog.md README.md"
13 # Also install this custom path since internal paths depend on it.
14 RUBY_FAKEGEM_EXTRAINSTALL="exe"
16 RUBY_FAKEGEM_GEMSPEC="rspec-core.gemspec"
20 DESCRIPTION="A Behaviour Driven Development (BDD) framework for Ruby"
21 HOMEPAGE="https://github.com/rspec/rspec-core"
22 SRC_URI="https://github.com/rspec/${PN}/archive/v${PV}.tar.gz -> ${P}-git.tgz"
26 KEYWORDS="~amd64 ~arm ~hppa ~ppc64"
29 SUBVERSION="$(get_version_component_range 1-2)"
32 =dev-ruby/rspec-support-${SUBVERSION}*
33 !!<dev-ruby/rspec-core-2.14.8-r4
34 highlight? ( >=dev-ruby/coderay-1.0.9 )
37 ruby_add_bdepend "test? (
38 >=dev-ruby/nokogiri-1.5.2
39 >=dev-ruby/coderay-1.0.9
41 >=dev-ruby/thread_order-1.1.0
42 >=dev-ruby/zentest-4.6.2
43 >=dev-ruby/rspec-expectations-3.3.0:3
44 >=dev-ruby/rspec-mocks-2.99.0:3
47 # Skip yard for ruby22 for now since we don't support ruby22 eselected
48 # yet and we can't bootstrap otherwise.
49 USE_RUBY=${USE_RUBY/ruby22/} ruby_add_bdepend "doc? ( dev-ruby/yard )"
52 # Don't set up bundler: it doesn't understand our setup.
53 sed -i -e '/[Bb]undler/d' Rakefile || die
55 # Avoid dependency on cucumber since we can't run the features anyway.
56 sed -i -e '/[Cc]ucumber/ s:^:#:' Rakefile || die
58 # Duplicate exe also in bin. We can't change it since internal stuff
59 # also depends on this and fixing that is going to be fragile. This
60 # way we can at least install proper bin scripts.
63 # Avoid unneeded dependency on git.
64 sed -i -e 's/git ls-files --/find/' rspec-core.gemspec || die
66 # Avoid aruba dependency so that we don't end up in dependency hell.
67 sed -i -e '/ArubaLoader/,/^end/ s:^:#:' -e '/Aruba/ s:^:#:' spec/spec_helper.rb || die
68 rm spec/integration/{filtering,order,persistence_failures}_spec.rb spec/support/aruba_support.rb || die
70 # Avoid a spec failing due to path issues
71 sed -i -e '/does not load files in the default path when run by ruby/,/end/ s:^:#:' \
72 spec/rspec/core/configuration_spec.rb || die
76 sed -i -e 's:ruby -e:'${RUBY}' -e:' spec/rspec/core_spec.rb || die
80 # # The rubygems version bundled with ruby 2.2 causes warnings.
81 # sed -i -e '/a library that issues no warnings when loaded/,/^ end/ s:^:#:' spec/rspec/core_spec.rb || die
93 PATH="${S}/bin:${PATH}" RUBYLIB="${S}/lib" ${RUBY} -Ilib bin/rspec spec || die "Tests failed."
99 ruby_fakegem_binwrapper rspec /usr/bin/rspec-3 'gem "rspec", "~>3.0"'