# Remove development dependencies from the gemspec that we don't
# need or can't satisfy.
sed -i -e '/\(coveralls\|spork\|simplecov\|bcat\|kramdown\|yard\|capybara\|octokit\|rack-test\|ramaze\|rubocop\|sinatra\|webrat\|mime-types\|rubyzip\)/d'${RUBY_FAKEGEM_GEMSPEC}|| die
# Avoid dependency on unpackaged cucumber-pro
sed -i -e '/cucumber-pro/ s:^:#:' Gemfile || die
# Avoid harmless failing spec
sed -i -e '/converts the snapshot path to a relative path/,/end/ s:^:#:'\
spec/cucumber/formatter/html_spec.rb || die
# Avoid failing features on new delegate and forwardable behavior in ruby
rm -f features/docs/defining_steps/ambiguous_steps.feature features/docs/defining_steps/nested_steps.feature || die
# Avoid dependency on git
sed -i -e '/executables/ s/=.*/= ["cucumber"]/'\
-e '/git ls-files/d' cucumber.gemspec || die
sed -i -e '/pry/ s:^:#:' cucumber.gemspec spec/spec_helper.rb || die
rm -f Gemfile.lock || die
}
each_ruby_prepare(){
# Use the right interpreter
sed -i -e 's:ruby:'${RUBY}':' features/lib/step_definitions/ruby_steps.rb || die
}
each_ruby_test(){
RSPEC_VERSION=3 ruby-ng_rspec
CUCUMBER_USE_RELEASED_CORE=truePATH="${S}"/bin:${PATH}RUBYLIB="${S}"/lib ${RUBY} -Ilib bin/cucumber features || die "Features failed"
}
all_ruby_install(){
all_fakegem_install
if use examples;then
cp -pPR examples "${D}/usr/share/doc/${PF}"|| die "Failed installing example files."