/[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.33 Revision 1.34
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-fakegem.eclass,v 1.33 2012/07/05 21:23:01 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.34 2012/08/13 22:21:26 flameeyes 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# - cucumber (calls ruby-ng_cucumber, adds dev-util/cucumber to the
39# dependencies; does not work on JRuby).
38# - none 40# - none
39# RUBY_FAKEGEM_RECIPE_TEST="rake" 41# RUBY_FAKEGEM_RECIPE_TEST="rake"
40 42
41# @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_TEST 43# @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_TEST
42# @DESCRIPTION: 44# @DESCRIPTION:
104 ruby_add_bdepend "test? ( dev-ruby/rake )" 106 ruby_add_bdepend "test? ( dev-ruby/rake )"
105 ;; 107 ;;
106 rspec) 108 rspec)
107 IUSE+=" test" 109 IUSE+=" test"
108 ruby_add_bdepend "test? ( dev-ruby/rspec:2 )" 110 ruby_add_bdepend "test? ( dev-ruby/rspec:2 )"
111 ;;
112 cucumber)
113 IUSE+=" test"
114 # Unfortunately as of August 2012, cucumber is not supported on
115 # JRuby. We work it around here to avoid repeating the same
116 # code over and over again.
117 USE_RUBY="${USE_RUBY/jruby/}" ruby_add_bdepend "test? ( dev-util/cucumber )"
109 ;; 118 ;;
110 *) 119 *)
111 RUBY_FAKEGEM_RECIPE_TEST="none" 120 RUBY_FAKEGEM_RECIPE_TEST="none"
112 ;; 121 ;;
113esac 122esac
235 # copies with different implementations; while for now we're using 244 # copies with different implementations; while for now we're using
236 # the same exact content, we might have differences in the future, 245 # the same exact content, we might have differences in the future,
237 # so better taking this into consideration. 246 # so better taking this into consideration.
238 local quoted_description=${DESCRIPTION//\"/\\\"} 247 local quoted_description=${DESCRIPTION//\"/\\\"}
239 cat - > $1 <<EOF 248 cat - > $1 <<EOF
240# generated by ruby-fakegem.eclass $Revision: 1.33 $ 249# generated by ruby-fakegem.eclass $Revision: 1.34 $
241Gem::Specification.new do |s| 250Gem::Specification.new do |s|
242 s.name = "${RUBY_FAKEGEM_NAME}" 251 s.name = "${RUBY_FAKEGEM_NAME}"
243 s.version = "${RUBY_FAKEGEM_VERSION}" 252 s.version = "${RUBY_FAKEGEM_VERSION}"
244 s.summary = "${quoted_description}" 253 s.summary = "${quoted_description}"
245 s.homepage = "${HOMEPAGE}" 254 s.homepage = "${HOMEPAGE}"
285 294
286 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF 295 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
287#!${rubycmd} 296#!${rubycmd}
288# This is a simplified version of the RubyGems wrapper 297# This is a simplified version of the RubyGems wrapper
289# 298#
290# Generated by ruby-fakegem.eclass $Revision: 1.33 $ 299# Generated by ruby-fakegem.eclass $Revision: 1.34 $
291 300
292require 'rubygems' 301require 'rubygems'
293 302
294load Gem::default_path[-1] + "/gems/${relativegembinary}" 303load Gem::default_path[-1] + "/gems/${relativegembinary}"
295 304
372 ${RUBY} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed" 381 ${RUBY} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
373 ;; 382 ;;
374 rspec) 383 rspec)
375 ruby-ng_rspec 384 ruby-ng_rspec
376 ;; 385 ;;
386 cucumber)
387 ruby-ng_cucumber
388 ;;
377 none) 389 none)
378 ewarn "each_fakegem_test called, but \${RUBY_FAKEGEM_RECIPE_TEST} is 'none'" 390 ewarn "each_fakegem_test called, but \${RUBY_FAKEGEM_RECIPE_TEST} is 'none'"
379 ;; 391 ;;
380 esac 392 esac
381} 393}

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.20