/[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.48 Revision 1.51
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.48 2012/07/08 12:38:10 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.51 2012/09/27 16:35:41 axs 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# @AUTHOR: 8# @AUTHOR:
75 75
76case ${EAPI} in 76case ${EAPI} in
77 0|1) 77 0|1)
78 die "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;; 78 die "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;;
79 2|3) ;; 79 2|3) ;;
80 4) 80 4|5)
81 # S is no longer automatically assigned when it doesn't exist. 81 # S is no longer automatically assigned when it doesn't exist.
82 S="${WORKDIR}" 82 S="${WORKDIR}"
83 ;; 83 ;;
84 *) 84 *)
85 die "Unknown EAPI=${EAPI} for ruby-ng.eclass" 85 die "Unknown EAPI=${EAPI} for ruby-ng.eclass"
312# ruby useflag and dependency. 312# ruby useflag and dependency.
313if [[ ${RUBY_OPTIONAL} != yes ]]; then 313if [[ ${RUBY_OPTIONAL} != yes ]]; then
314 DEPEND="${DEPEND} $(ruby_implementations_depend)" 314 DEPEND="${DEPEND} $(ruby_implementations_depend)"
315 RDEPEND="${RDEPEND} $(ruby_implementations_depend)" 315 RDEPEND="${RDEPEND} $(ruby_implementations_depend)"
316 316
317 case ${EAPI:-0} in
318 4|5)
317 [[ ${EAPI:-0} -ge 4 ]] && REQUIRED_USE+=" || ( $(ruby_get_use_targets) )" 319 REQUIRED_USE+=" || ( $(ruby_get_use_targets) )"
320 ;;
321 esac
318fi 322fi
319 323
320_ruby_invoke_environment() { 324_ruby_invoke_environment() {
321 old_S=${S} 325 old_S=${S}
322 case ${EAPI} in 326 case ${EAPI} in
323 4) 327 4|5)
324 if [ -z ${RUBY_S} ]; then 328 if [ -z ${RUBY_S} ]; then
325 sub_S=${P} 329 sub_S=${P}
326 else 330 else
327 sub_S=${RUBY_S} 331 sub_S=${RUBY_S}
328 fi 332 fi
657 esac 661 esac
658 662
659 ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed" 663 ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed"
660} 664}
661 665
666# @FUNCTION: ruby-ng_cucumber
667# @DESCRIPTION:
668# This is simply a wrapper around the cucumber command (executed by $RUBY})
669# which also respects TEST_VERBOSE and NOCOLOR environment variables.
670ruby-ng_cucumber() {
671 if [[ ${DEPEND} != *"dev-util/cucumber"* ]]; then
672 ewarn "Missing dev-util/cucumber in \${DEPEND}"
673 fi
674
675 local cucumber_params=
676 case ${NOCOLOR} in
677 1|yes|true)
678 cucumber_params+=" --no-color"
679 ;;
680 *)
681 cucumber_params+=" --color"
682 ;;
683 esac
684
685 case ${TEST_VERBOSE} in
686 1|yes|true)
687 cucumber_params+=" --format pretty"
688 ;;
689 *)
690 cucumber_params+=" --format progress"
691 ;;
692 esac
693
694 if [[ ${RUBY} == *jruby ]]; then
695 ewarn "Skipping cucumber tests on JRuby (unsupported)."
696 return 0
697 fi
698
699 ${RUBY} -S cucumber ${cucumber_params} "$@" || die "cucumber failed"
700}
701
662# @FUNCTION: ruby-ng_testrb-2 702# @FUNCTION: ruby-ng_testrb-2
663# @DESCRIPTION: 703# @DESCRIPTION:
664# This is simply a replacement for the testrb command that load the test 704# This is simply a replacement for the testrb command that load the test
665# files and execute them, with test-unit 2.x. This actually requires 705# files and execute them, with test-unit 2.x. This actually requires
666# either an old test-unit-2 version or 2.5.1-r1 or later, as they remove 706# either an old test-unit-2 version or 2.5.1-r1 or later, as they remove

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20