sys-cluster/kube-apiserver: Remove old
[gentoo.git] / eclass / ruby-utils.eclass
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: ruby-utils.eclass
5 # @MAINTAINER:
6 # Ruby team <ruby@gentoo.org>
7 # @AUTHOR:
8 # Author: Hans de Graaff <graaff@gentoo.org>
9 # @BLURB: An eclass for supporting ruby scripts and bindings in non-ruby packages
10 # @DESCRIPTION:
11 # The ruby-utils eclass is designed to allow an easier installation of
12 # Ruby scripts and bindings for non-ruby packages.
13 #
14 # This eclass does not set any metadata variables nor export any phase
15 # functions. It can be inherited safely.
16
17
18 if [[ ! ${_RUBY_UTILS} ]]; then
19
20
21 # @ECLASS-VARIABLE: RUBY_TARGETS_PREFERENCE
22 # @DESCRIPTION:
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.
28
29 # All RUBY_TARGETS
30 RUBY_TARGETS_PREFERENCE="ruby22 ruby21 "
31
32 # All other active ruby targets
33 RUBY_TARGETS_PREFERENCE+="ruby23 ruby24"
34
35
36 _ruby_implementation_depend() {
37         local rubypn=
38         local rubyslot=
39
40         case $1 in
41                 ruby18)
42                         rubypn="dev-lang/ruby"
43                         rubyslot=":1.8"
44                         ;;
45                 ruby19)
46                         rubypn="dev-lang/ruby"
47                         rubyslot=":1.9"
48                         ;;
49                 ruby20)
50                         rubypn="dev-lang/ruby"
51                         rubyslot=":2.0"
52                         ;;
53                 ruby21)
54                         rubypn="dev-lang/ruby"
55                         rubyslot=":2.1"
56                         ;;
57                 ruby22)
58                         rubypn="dev-lang/ruby"
59                         rubyslot=":2.2"
60                         ;;
61                 ruby23)
62                         rubypn="dev-lang/ruby"
63                         rubyslot=":2.3"
64                         ;;
65                 ruby24)
66                         rubypn="dev-lang/ruby"
67                         rubyslot=":2.4"
68                         ;;
69                 ree18)
70                         rubypn="dev-lang/ruby-enterprise"
71                         rubyslot=":1.8"
72                         ;;
73                 jruby)
74                         rubypn="dev-java/jruby"
75                         rubyslot=""
76                         ;;
77                 rbx)
78                         rubypn="dev-lang/rubinius"
79                         rubyslot=""
80                         ;;
81                 *) die "$1: unknown Ruby implementation"
82         esac
83
84         echo "$2${rubypn}$3${rubyslot}"
85 }
86
87
88
89 _RUBY_UTILS=1
90 fi