1 # Copyright 1999-2018 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
24 # This variable lists all the known ruby targets in preference of use as
25 # determined by the ruby team. By using this ordering rather than the
26 # USE_RUBY mandated ordering we have more control over which ruby
27 # implementation will be installed first (and thus eselected). This will
28 # provide for a better first installation experience.
31 RUBY_TARGETS_PREFERENCE="ruby23 "
33 # All other active ruby targets
34 RUBY_TARGETS_PREFERENCE+="ruby24 ruby25"
37 _ruby_implementation_depend() {
43 rubypn="dev-lang/ruby"
47 rubypn="dev-lang/ruby"
51 rubypn="dev-lang/ruby"
55 rubypn="dev-lang/ruby"
59 rubypn="dev-lang/ruby"
63 rubypn="dev-lang/ruby"
67 rubypn="dev-lang/ruby"
71 rubypn="dev-lang/ruby"
75 rubypn="dev-lang/ruby-enterprise"
79 rubypn="dev-java/jruby"
83 rubypn="dev-lang/rubinius"
86 *) die "$1: unknown Ruby implementation"
89 echo "$2${rubypn}$3${rubyslot}"