/[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.36 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.36 2012/08/15 15:06:09 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.36 $ 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.36 $ 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

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

  ViewVC Help
Powered by ViewVC 1.1.20