/[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.47 Revision 1.49
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.47 2012/07/05 21:23:01 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.49 2012/08/13 21:18:41 flameeyes 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:
656 ;; 656 ;;
657 esac 657 esac
658 658
659 ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed" 659 ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed"
660} 660}
661
662# @FUNCTION: ruby-ng_cucumber
663# @DESCRIPTION:
664# This is simply a wrapper around the cucumber command (executed by $RUBY})
665# which also respects TEST_VERBOSE and NOCOLOR environment variables.
666ruby-ng_cucumber() {
667 if [[ ${DEPEND} != *"dev-util/cucumber"* ]]; then
668 ewarn "Missing dev-util/cucumber in \${DEPEND}"
669 fi
670
671 local cucumber_params=
672 case ${NOCOLOR} in
673 1|yes|true)
674 cucumber_params+=" --no-color"
675 ;;
676 *)
677 cucumber_params+=" --color"
678 ;;
679 esac
680
681 case ${TEST_VERBOSE} in
682 1|yes|true)
683 cucumber_params+=" --format pretty"
684 ;;
685 *)
686 cucumber_params+=" --format progress"
687 ;;
688 esac
689
690 ${RUBY} -S cucumber ${cucumber_params} "$@" || die "cucumber failed"
691}
692
693# @FUNCTION: ruby-ng_testrb-2
694# @DESCRIPTION:
695# This is simply a replacement for the testrb command that load the test
696# files and execute them, with test-unit 2.x. This actually requires
697# either an old test-unit-2 version or 2.5.1-r1 or later, as they remove
698# their script and we installed a broken wrapper for a while.
699# This also respects TEST_VERBOSE and NOCOLOR environment variables.
700ruby-ng_testrb-2() {
701 if [[ ${DEPEND} != *"dev-ruby/test-unit"* ]]; then
702 ewarn "Missing dev-ruby/test-unit in \${DEPEND}"
703 fi
704
705 local testrb_params=
706 case ${NOCOLOR} in
707 1|yes|true)
708 testrb_params+=" --no-use-color"
709 ;;
710 *)
711 testrb_params+=" --use-color=auto"
712 ;;
713 esac
714
715 case ${TEST_VERBOSE} in
716 1|yes|true)
717 testrb_params+=" --verbose=verbose"
718 ;;
719 *)
720 testrb_params+=" --verbose=normal"
721 ;;
722 esac
723
724 ${RUBY} -S testrb-2 ${testrb_params} "$@" || die "testrb-2 failed"
725}

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.20