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

Diff of /eclass/ruby-fakegem.eclass

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

Revision 1.43 Revision 1.44
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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-fakegem.eclass,v 1.43 2014/12/28 07:23:56 graaff Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.44 2014/12/28 10:13:18 graaff Exp $
4 4
5# @ECLASS: ruby-fakegem.eclass 5# @ECLASS: ruby-fakegem.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ruby herd <ruby@gentoo.org> 7# Ruby herd <ruby@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
33# @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_TEST 33# @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_TEST
34# @DESCRIPTION: 34# @DESCRIPTION:
35# Specify one of the default testing function for ruby-fakegem: 35# Specify one of the default testing function for ruby-fakegem:
36# - rake (default; see also RUBY_FAKEGEM_TASK_TEST) 36# - rake (default; see also RUBY_FAKEGEM_TASK_TEST)
37# - rspec (calls ruby-ng_rspec, adds dev-ruby/rspec:2 to the dependencies) 37# - rspec (calls ruby-ng_rspec, adds dev-ruby/rspec:2 to the dependencies)
38# - rspec3 (calls ruby-ng_rspec, adds dev-ruby/rspec:3 to the dependencies)
38# - cucumber (calls ruby-ng_cucumber, adds dev-util/cucumber to the 39# - cucumber (calls ruby-ng_cucumber, adds dev-util/cucumber to the
39# dependencies; does not work on JRuby). 40# dependencies; does not work on JRuby).
40# - none 41# - none
41# RUBY_FAKEGEM_RECIPE_TEST="rake" 42# RUBY_FAKEGEM_RECIPE_TEST="rake"
42 43
142 rspec) 143 rspec)
143 IUSE+=" test" 144 IUSE+=" test"
144 # Also require a new enough rspec-core version that installs the 145 # Also require a new enough rspec-core version that installs the
145 # rspec-2 wrapper. 146 # rspec-2 wrapper.
146 ruby_add_bdepend "test? ( dev-ruby/rspec:2 >=dev-ruby/rspec-core-2.14.8-r2 )" 147 ruby_add_bdepend "test? ( dev-ruby/rspec:2 >=dev-ruby/rspec-core-2.14.8-r2 )"
148 ;;
149 rspec3)
150 IUSE+=" test"
151 ruby_add_bdepend "test? ( dev-ruby/rspec:3 )"
147 ;; 152 ;;
148 cucumber) 153 cucumber)
149 IUSE+=" test" 154 IUSE+=" test"
150 # Unfortunately as of August 2012, cucumber is not supported on 155 # Unfortunately as of August 2012, cucumber is not supported on
151 # JRuby. We work it around here to avoid repeating the same 156 # JRuby. We work it around here to avoid repeating the same
287 # copies with different implementations; while for now we're using 292 # copies with different implementations; while for now we're using
288 # the same exact content, we might have differences in the future, 293 # the same exact content, we might have differences in the future,
289 # so better taking this into consideration. 294 # so better taking this into consideration.
290 local quoted_description=${DESCRIPTION//\"/\\\"} 295 local quoted_description=${DESCRIPTION//\"/\\\"}
291 cat - > $1 <<EOF 296 cat - > $1 <<EOF
292# generated by ruby-fakegem.eclass $Revision: 1.43 $ 297# generated by ruby-fakegem.eclass $Revision: 1.44 $
293Gem::Specification.new do |s| 298Gem::Specification.new do |s|
294 s.name = "${RUBY_FAKEGEM_NAME}" 299 s.name = "${RUBY_FAKEGEM_NAME}"
295 s.version = "${RUBY_FAKEGEM_VERSION}" 300 s.version = "${RUBY_FAKEGEM_VERSION}"
296 s.summary = "${quoted_description}" 301 s.summary = "${quoted_description}"
297 s.homepage = "${HOMEPAGE}" 302 s.homepage = "${HOMEPAGE}"
340 345
341 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF 346 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
342#!${rubycmd} 347#!${rubycmd}
343# This is a simplified version of the RubyGems wrapper 348# This is a simplified version of the RubyGems wrapper
344# 349#
345# Generated by ruby-fakegem.eclass $Revision: 1.43 $ 350# Generated by ruby-fakegem.eclass $Revision: 1.44 $
346 351
347require 'rubygems' 352require 'rubygems'
348 353
349${content} 354${content}
350load Gem::default_path[-1] + "/gems/${relativegembinary}" 355load Gem::default_path[-1] + "/gems/${relativegembinary}"
438 ${RUBY} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed" 443 ${RUBY} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
439 ;; 444 ;;
440 rspec) 445 rspec)
441 RSPEC_VERSION=2 ruby-ng_rspec 446 RSPEC_VERSION=2 ruby-ng_rspec
442 ;; 447 ;;
448 rspec3)
449 RSPEC_VERSION=3 ruby-ng_rspec
450 ;;
443 cucumber) 451 cucumber)
444 ruby-ng_cucumber 452 ruby-ng_cucumber
445 ;; 453 ;;
446 none) 454 none)
447 ewarn "each_fakegem_test called, but \${RUBY_FAKEGEM_RECIPE_TEST} is 'none'" 455 ewarn "each_fakegem_test called, but \${RUBY_FAKEGEM_RECIPE_TEST} is 'none'"

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

  ViewVC Help
Powered by ViewVC 1.1.20