/[gentoo-x86]/eclass/ruby-ng.eclass
Gentoo

Diff of /eclass/ruby-ng.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.9 Revision 1.10
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.9 2010/04/02 20:26:21 a3li Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.10 2010/04/05 07:41:09 a3li Exp $
4# 4#
5# @ECLASS: ruby-ng.eclass 5# @ECLASS: ruby-ng.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ruby herd <ruby@gentoo.org> 7# Ruby herd <ruby@gentoo.org>
8# 8#
446 rubyhdrdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["archdir"]') 446 rubyhdrdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["archdir"]')
447 fi 447 fi
448 448
449 echo "${rubyhdrdir}" 449 echo "${rubyhdrdir}"
450} 450}
451
452# @FUNCTION: ruby_get_version
453# @RETURN: The version of the Ruby interpreter in ${RUBY}, or what 'ruby' points to.
454ruby_get_version() {
455 local ruby=${RUBY:-$(type -p ruby 2>/dev/null)}
456
457 echo $(${ruby} -e 'puts RUBY_VERSION')
458}
459
460# @FUNCTION: ruby_get_implementation
461# @RETURN: The implementation of the Ruby interpreter in ${RUBY}, or what 'ruby' points to.
462ruby_get_implementation() {
463 local ruby=${RUBY:-$(type -p ruby 2>/dev/null)}
464
465 case $(${ruby} --version) in
466 *Enterprise*)
467 echo "ree"
468 ;;
469 *jruby*)
470 echo "jruby"
471 ;;
472 *)
473 echo "mri"
474 ;;
475 esac
476}

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20