summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-12-16 09:51:30 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-12-16 09:51:30 +0000
commit3925e6a3ab77de48562ed07d42d276bde80b288b (patch)
tree49b0d9d9583ae3a5a88d58b800388346845fa14c /eclass
parentupdated live ebuild's makefile patch (diff)
downloadgentoo-2-3925e6a3ab77de48562ed07d42d276bde80b288b.tar.gz
gentoo-2-3925e6a3ab77de48562ed07d42d276bde80b288b.tar.bz2
gentoo-2-3925e6a3ab77de48562ed07d42d276bde80b288b.zip
Change the binary wrapper code.
Instead of using the Gem code to find the gem itself (which only worked for gems whose library was named after the gem, and failed for spec and other packages), ask Gem for its system path (which will be dynamic depending on the Ruby implementation used) and affix the hardcoded relative path of the wrapper (which we know at merge time). Tested with rake, bluecloth, rspec, Ruby 1.8, 1.9 and JRuby.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ruby-fakegem.eclass5
1 files changed, 3 insertions, 2 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 59f3ac850e77..4388901c3848 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.4 2009/12/15 17:43:51 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.5 2009/12/16 09:51:30 flameeyes Exp $
#
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
@@ -151,6 +151,7 @@ ruby_fakegem_binwrapper() {
(
local gembinary=$1
local newbinary=${2:-/usr/bin/$gembinary}
+ local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
#!/usr/bin/env ruby
@@ -160,7 +161,7 @@ ruby_fakegem_binwrapper() {
require 'rubygems'
-load Gem::GemPathSearcher.new.find('$(tr [A-Z] [a-z] <<< ${RUBY_FAKEGEM_NAME})').full_gem_path + "/bin/${gembinary}"
+load Gem::default_path[-1] + "/gems/${relativegembinary}"
EOF