aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <hans@degraaff.org>2015-05-11 20:24:42 +0200
committerHans de Graaff <hans@degraaff.org>2015-05-11 20:24:42 +0200
commit3bb3c9e4d9439e3f814ab53337bd24d7822681fe (patch)
treed89921f4bce08e878c4ccaf5542ac907bced682e
parent[travis] Update travis.yml (diff)
downloadruby-overlay-3bb3c9e4d9439e3f814ab53337bd24d7822681fe.tar.gz
ruby-overlay-3bb3c9e4d9439e3f814ab53337bd24d7822681fe.tar.bz2
ruby-overlay-3bb3c9e4d9439e3f814ab53337bd24d7822681fe.zip
Sync with ruby-ng.eclass in the gentoo repository.
-rw-r--r--eclass/ruby-ng.eclass18
-rw-r--r--eclass/ruby-utils.eclass3
2 files changed, 19 insertions, 2 deletions
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index 5af4683..a06fcd4 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -19,6 +19,7 @@
# * ruby19 - Ruby (MRI) 1.9.x
# * ruby20 - Ruby (MRI) 2.0.x
# * ruby21 - Ruby (MRI) 2.1.x
+# * ruby22 - Ruby (MRI) 2.2.x
# * ree18 - Ruby Enterprise Edition 1.8.x
# * jruby - JRuby
# * rbx - Rubinius
@@ -608,11 +609,24 @@ ruby_get_implementation() {
esac
}
-# @FUNCTION: ruby-ng_rspec
+# @FUNCTION: ruby-ng_rspec <arguments>
# @DESCRIPTION:
# This is simply a wrapper around the rspec command (executed by $RUBY})
# which also respects TEST_VERBOSE and NOCOLOR environment variables.
+# Optionally takes arguments to pass on to the rspec invocation. The
+# environment variable RSPEC_VERSION can be used to control the specific
+# rspec version that must be executed. It defaults to 2 for historical
+# compatibility.
ruby-ng_rspec() {
+ local version=${RSPEC_VERSION-2}
+ local files="$@"
+
+ # Explicitly pass the expected spec directory since the versioned
+ # rspec wrappers don't handle this automatically.
+ if [ ${#@} -eq 0 ]; then
+ files="spec"
+ fi
+
if [[ ${DEPEND} != *"dev-ruby/rspec"* ]]; then
ewarn "Missing dev-ruby/rspec in \${DEPEND}"
fi
@@ -636,7 +650,7 @@ ruby-ng_rspec() {
;;
esac
- ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed"
+ ${RUBY} -S rspec-${version} ${rspec_params} ${files} || die "rspec failed"
}
# @FUNCTION: ruby-ng_cucumber
diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index 2693045..9aef502 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -63,6 +63,9 @@ _ruby_implementation_depend() {
rubypn="dev-lang/ruby"
rubyslot=":2.1"
;;
+ ruby22)
+ rubypn="dev-lang/ruby"
+ rubyslot=":2.2"
ree18)
rubypn="dev-lang/ruby-enterprise"
rubyslot=":1.8"