graaff      14/12/07 07:23:12

  Modified:             ChangeLog ruby-fakegem.eclass
  Log:
  Allow additional content to be injected in the ruby bin wrapper.

Revision  Changes    Path
1.1454               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1454&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1454&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1453&r2=1.1454

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1453
retrieving revision 1.1454
diff -u -r1.1453 -r1.1454
--- ChangeLog   4 Dec 2014 10:32:10 -0000       1.1453
+++ ChangeLog   7 Dec 2014 07:23:12 -0000       1.1454
@@ -1,6 +1,9 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1453 2014/12/04 
10:32:10 mrueg Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1454 2014/12/07 
07:23:12 graaff Exp $
+
+  07 Dec 2014; Hans de Graaff <[email protected]> ruby-fakegem.eclass:
+  Allow additional content to be injected in the ruby bin wrapper.
 
   04 Dec 2014; Manuel RĂ¼ger <[email protected]> kde4-base.eclass:
   Sync kde4-base.eclass with overlay.



1.42                 eclass/ruby-fakegem.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.42&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.42&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.41&r2=1.42

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- ruby-fakegem.eclass 21 Apr 2014 07:35:43 -0000      1.41
+++ ruby-fakegem.eclass 7 Dec 2014 07:23:12 -0000       1.42
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.41 
2014/04/21 07:35:43 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.42 
2014/12/07 07:23:12 graaff Exp $
 
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -287,7 +287,7 @@
        # so better taking this into consideration.
        local quoted_description=${DESCRIPTION//\"/\\\"}
        cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.41 $
+# generated by ruby-fakegem.eclass $Revision: 1.42 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -299,14 +299,17 @@
 }
 
 # @FUNCTION: ruby_fakegem_binwrapper
-# @USAGE: command [path]
+# @USAGE: command [path] [content]
 # @DESCRIPTION:
 # Creates a new binary wrapper for a command installed by the RubyGem.
-# path defaults to /usr/bin/$command
+# path defaults to /usr/bin/$command content is optional and can be used
+# to inject additional ruby code into the wrapper. This may be useful to
+# e.g. force a specific version using the gem command.
 ruby_fakegem_binwrapper() {
        (
                local gembinary=$1
                local newbinary=${2:-/usr/bin/$gembinary}
+               local content=$3
                local 
relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
                local binpath=$(dirname $newbinary)
                [[ ${binpath} = . ]] && binpath=/usr/bin
@@ -337,10 +340,11 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.41 $
+# Generated by ruby-fakegem.eclass $Revision: 1.42 $
 
 require 'rubygems'
 
+${content}
 load Gem::default_path[-1] + "/gems/${relativegembinary}"
 
 EOF




Reply via email to