/[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.35 Revision 1.37
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.35 2012/08/14 21:10:45 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.37 2012/08/19 07:45:02 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:
243# @DESCRIPTION: 243# @DESCRIPTION:
244# Generates an installable version of the specification indicated by 244# Generates an installable version of the specification indicated by
245# the metadata distributed by the gem itself. This is similar to how 245# the metadata distributed by the gem itself. This is similar to how
246# rubygems creates an installation from a .gem file. 246# rubygems creates an installation from a .gem file.
247ruby_fakegem_metadata_gemspec() { 247ruby_fakegem_metadata_gemspec() {
248 case ${RUBY} in
249 *ruby19)
250 ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2
251 ;;
252 *)
248 ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2 253 ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
254 ;;
255 esac
249} 256}
250 257
251# @FUNCTION: ruby_fakegem_genspec 258# @FUNCTION: ruby_fakegem_genspec
252# @USAGE: output-gemspec 259# @USAGE: output-gemspec
253# @DESCRIPTION: 260# @DESCRIPTION:
271 # copies with different implementations; while for now we're using 278 # copies with different implementations; while for now we're using
272 # the same exact content, we might have differences in the future, 279 # the same exact content, we might have differences in the future,
273 # so better taking this into consideration. 280 # so better taking this into consideration.
274 local quoted_description=${DESCRIPTION//\"/\\\"} 281 local quoted_description=${DESCRIPTION//\"/\\\"}
275 cat - > $1 <<EOF 282 cat - > $1 <<EOF
276# generated by ruby-fakegem.eclass $Revision: 1.35 $ 283# generated by ruby-fakegem.eclass $Revision: 1.37 $
277Gem::Specification.new do |s| 284Gem::Specification.new do |s|
278 s.name = "${RUBY_FAKEGEM_NAME}" 285 s.name = "${RUBY_FAKEGEM_NAME}"
279 s.version = "${RUBY_FAKEGEM_VERSION}" 286 s.version = "${RUBY_FAKEGEM_VERSION}"
280 s.summary = "${quoted_description}" 287 s.summary = "${quoted_description}"
281 s.homepage = "${HOMEPAGE}" 288 s.homepage = "${HOMEPAGE}"
321 328
322 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF 329 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
323#!${rubycmd} 330#!${rubycmd}
324# This is a simplified version of the RubyGems wrapper 331# This is a simplified version of the RubyGems wrapper
325# 332#
326# Generated by ruby-fakegem.eclass $Revision: 1.35 $ 333# Generated by ruby-fakegem.eclass $Revision: 1.37 $
327 334
328require 'rubygems' 335require 'rubygems'
329 336
330load Gem::default_path[-1] + "/gems/${relativegembinary}" 337load Gem::default_path[-1] + "/gems/${relativegembinary}"
331 338
339# @FUNCTION: all_fakegem_compile 346# @FUNCTION: all_fakegem_compile
340# @DESCRIPTION: 347# @DESCRIPTION:
341# Build documentation for the package if indicated by the doc USE flag 348# Build documentation for the package if indicated by the doc USE flag
342# and if there is a documetation task defined. 349# and if there is a documetation task defined.
343all_fakegem_compile() { 350all_fakegem_compile() {
344 if use doc; then 351 if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
345 case ${RUBY_FAKEGEM_RECIPE_DOC} in 352 case ${RUBY_FAKEGEM_RECIPE_DOC} in
346 rake) 353 rake)
347 rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation" 354 rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
348 ;; 355 ;;
349 rdoc) 356 rdoc)

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.37

  ViewVC Help
Powered by ViewVC 1.1.20