1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: ruby-utils.eclass
6 # Ruby team <ruby@gentoo.org>
8 # Author: Hans de Graaff <graaff@gentoo.org>
9 # @BLURB: An eclass for supporting ruby scripts and bindings in non-ruby packages
11 # The ruby-utils eclass is designed to allow an easier installation of
12 # Ruby scripts and bindings for non-ruby packages.
14 # This eclass does not set any metadata variables nor export any phase
15 # functions. It can be inherited safely.
18 if [[ ! ${_RUBY_UTILS} ]]; then
21 # @ECLASS-VARIABLE: RUBY_TARGETS_PREFERENCE
23 # This variable lists all the known ruby targets in preference of use as
24 # determined by the ruby team. By using this ordering rather than the
25 # USE_RUBY mandated ordering we have more control over which ruby
26 # implementation will be installed first (and thus eselected). This will
27 # provide for a better first installation experience.
30 RUBY_TARGETS_PREFERENCE="ruby22 ruby21 "
32 # All other active ruby targets
33 RUBY_TARGETS_PREFERENCE+="ruby23 ruby24"
36 _ruby_implementation_depend() {
42 rubypn="dev-lang/ruby"
46 rubypn="dev-lang/ruby"
50 rubypn="dev-lang/ruby"
54 rubypn="dev-lang/ruby"
58 rubypn="dev-lang/ruby"
62 rubypn="dev-lang/ruby"
66 rubypn="dev-lang/ruby"
70 rubypn="dev-lang/ruby-enterprise"
74 rubypn="dev-java/jruby"
78 rubypn="dev-lang/rubinius"
81 *) die "$1: unknown Ruby implementation"
84 echo "$2${rubypn}$3${rubyslot}"