From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Nygvo-0007du-Op for garchives@archives.gentoo.org; Mon, 05 Apr 2010 07:41:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 84F33E0808; Mon, 5 Apr 2010 07:41:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5A759E0808 for ; Mon, 5 Apr 2010 07:41:11 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id EC6CC1B406E for ; Mon, 5 Apr 2010 07:41:10 +0000 (UTC) Received: from a3li by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Nygvl-0007u5-UF for gentoo-commits@lists.gentoo.org; Mon, 05 Apr 2010 07:41:09 +0000 From: "Alex Legler (a3li)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, a3li@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: ruby-ng.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: ruby-ng.eclass X-VCS-Directories: eclass X-VCS-Committer: a3li X-VCS-Committer-Name: Alex Legler Content-Type: text/plain; charset=utf8 Message-Id: Sender: Alex Legler Date: Mon, 05 Apr 2010 07:41:09 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 35e33e26-6769-4bff-9c2c-09f58abbceb2 X-Archives-Hash: d5fd814e7acd3b76d475a31c7f9c1362 a3li 10/04/05 07:41:09 Modified: ruby-ng.eclass Log: Add ruby_get_version() and ruby_get_implementation() convenience helper= functions Revision Changes Path 1.10 eclass/ruby-ng.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-ng.ecl= ass?rev=3D1.10&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-ng.ecl= ass?rev=3D1.10&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-ng.ecl= ass?r1=3D1.9&r2=3D1.10 Index: ruby-ng.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ruby-ng.eclass 2 Apr 2010 20:26:21 -0000 1.9 +++ ruby-ng.eclass 5 Apr 2010 07:41:09 -0000 1.10 @@ -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.9 2010/04/0= 2 20:26:21 a3li Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.10 2010/04/= 05 07:41:09 a3li Exp $ # # @ECLASS: ruby-ng.eclass # @MAINTAINER: @@ -448,3 +448,29 @@ =20 echo "${rubyhdrdir}" } + +# @FUNCTION: ruby_get_version +# @RETURN: The version of the Ruby interpreter in ${RUBY}, or what 'ruby= ' points to. +ruby_get_version() { + local ruby=3D${RUBY:-$(type -p ruby 2>/dev/null)} + + echo $(${ruby} -e 'puts RUBY_VERSION') +} + +# @FUNCTION: ruby_get_implementation +# @RETURN: The implementation of the Ruby interpreter in ${RUBY}, or wha= t 'ruby' points to. +ruby_get_implementation() { + local ruby=3D${RUBY:-$(type -p ruby 2>/dev/null)} + + case $(${ruby} --version) in + *Enterprise*) + echo "ree" + ;; + *jruby*) + echo "jruby" + ;; + *) + echo "mri" + ;; + esac +}