summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2010-04-26 15:07:58 +0000
committerAlex Legler <a3li@gentoo.org>2010-04-26 15:07:58 +0000
commitb6054240499ea5e511ed5c5d2c78609d30128347 (patch)
tree7e64b3e0291779e7be6e05270948c514501cab9e /eclass
parentadd a blocker for media-gfx/fondu which also has a tobin (bug #289715) (diff)
downloadgentoo-2-b6054240499ea5e511ed5c5d2c78609d30128347.tar.gz
gentoo-2-b6054240499ea5e511ed5c5d2c78609d30128347.tar.bz2
gentoo-2-b6054240499ea5e511ed5c5d2c78609d30128347.zip
Adding a ruby_rbconfig_value function to ruby-ng.eclass for easy access even to not regularly needed rbconfig data
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ruby-ng.eclass15
1 files changed, 11 insertions, 4 deletions
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index b8cb5d60ab12..41ffede517d9 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.10 2010/04/05 07:41:09 a3li Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.11 2010/04/26 15:07:58 a3li Exp $
#
# @ECLASS: ruby-ng.eclass
# @MAINTAINER:
@@ -418,6 +418,13 @@ ruby-ng_src_install() {
_ruby_each_implementation _each_ruby_check_install
}
+# @FUNCTION: ruby_rbconfig_value
+# @USAGE: rbconfig item
+# @RETURN: Returns the value of the given rbconfig item of the Ruby interpreter in ${RUBY}.
+ruby_rbconfig_value() {
+ echo $(${RUBY} -rrbconfig -e "puts Config::CONFIG['$1']")
+}
+
# @FUNCTION: doruby
# @USAGE: file [file...]
# @DESCRIPTION:
@@ -425,7 +432,7 @@ ruby-ng_src_install() {
doruby() {
[[ -z ${RUBY} ]] && die "\$RUBY is not set"
( # don't want to pollute calling env
- insinto $(${RUBY} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]')
+ insinto $(ruby_rbconfig_value 'sitelibdir')
insopts -m 0644
doins "$@"
) || die "failed to install $@"
@@ -440,10 +447,10 @@ ruby_get_libruby() {
# @FUNCTION: ruby_get_hdrdir
# @RETURN: The location of the header files belonging to the Ruby interpreter in ${RUBY}.
ruby_get_hdrdir() {
- local rubyhdrdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["rubyhdrdir"]')
+ local rubyhdrdir=$(ruby_rbconfig_value 'rubyhdrdir')
if [[ "${rubyhdrdir}" = "nil" ]] ; then
- rubyhdrdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["archdir"]')
+ rubyhdrdir=$(ruby_rbconfig_value 'archdir')
fi
echo "${rubyhdrdir}"