Permalink
Browse files

Executable wrapper template now uses Gem.ruby and is local ./gems aware

  • Loading branch information...
1 parent 3dd632c commit 4a087de5707abd7c0b837c81511cf7d1a5763ea1 @fabien committed Sep 27, 2008
Showing with 9 additions and 3 deletions.
  1. +1 −1 Rakefile
  2. +2 −1 lib/minigems.rb
  3. +5 −0 lib/minigems/executable_wrapper
  4. +1 −1 lib/minigems/script_helper.rb
View
@@ -15,7 +15,7 @@ GEM_EMAIL = "info@atelierfabien.be"
GEM_NAME = "minigems"
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
-GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.0") + PKG_BUILD
+GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.2") + PKG_BUILD
RELEASE_NAME = "REL #{GEM_VERSION}"
View
@@ -1,6 +1,6 @@
module Gem
module MiniGems
- VERSION = "0.9.0"
+ VERSION = "0.9.2"
# The next line needs to be kept exactly as shown; it's being replaced
# during minigems installation.
@@ -25,6 +25,7 @@ def self.camel_case(str)
require "rubygems/dependency"
require "rubygems/specification"
require "rbconfig"
+ require "pathname"
module Kernel
@@ -11,6 +11,11 @@ rescue LoadError
require 'rubygems'
end
+if File.directory?(gems_dir = File.join(Dir.pwd, 'gems')) ||
+ File.directory?(gems_dir = File.join(File.dirname(__FILE__), '..', 'gems'))
+ $BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir)
+end
+
version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
@@ -127,7 +127,7 @@ def remove_minigems!
def interpolate_wrapper(gem_name, executable_name, mode = 'minigems')
@template_code ||= File.read(File.join(minigems_path, 'lib', 'minigems', 'executable_wrapper'))
vars = { 'GEM_NAME' => gem_name, 'EXECUTABLE_NAME' => executable_name }
- vars['SHEBANG'] = "#!/usr/bin/env " + Gem::ConfigMap[:ruby_install_name]
+ vars['SHEBANG'] = "#!#{Gem.ruby}"
vars['GEM_MODE'] = mode
vars.inject(@template_code) { |str,(k,v)| str.gsub(k,v) }
end

0 comments on commit 4a087de

Please sign in to comment.