Permalink
Browse files

Small fixups

  • Loading branch information...
fabien committed Sep 19, 2008
1 parent a298afb commit 8bc3e5f130d895cbd0f28316cee65aceefa48d7b
Showing with 12 additions and 7 deletions.
  1. +1 −1 Rakefile
  2. +0 −1 bin/minigem
  3. +1 −1 lib/minigems.rb
  4. +5 −1 lib/minigems/executable_wrapper
  5. +5 −3 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.0.1") + PKG_BUILD
+GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.0") + PKG_BUILD
RELEASE_NAME = "REL #{GEM_VERSION}"
View
@@ -9,7 +9,6 @@ if ARGV.empty? || %w[-H --help].detect { |o| ARGV.index(o) }
program = File.basename($0)
puts "Usage:"
puts " #{program} setup"
- puts " #{program} remove"
puts " #{program} prepare GEMNAME [GEMNAME ...]"
puts " #{program} revert GEMNAME [GEMNAME ...]"
puts " #{program} install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]"
View
@@ -1,6 +1,6 @@
module Gem
module MiniGems
- VERSION = "0.0.1"
+ VERSION = "0.9.0"
# The next line needs to be kept exactly as shown; it's being replaced
# during minigems installation.
@@ -5,7 +5,11 @@ SHEBANG
# The application 'EXECUTABLE_NAME' is installed as part of a gem (GEM_NAME),
# and this file is here to facilitate running it.
-require 'GEM_MODE'
+begin
+ require 'GEM_MODE'
+rescue LoadError
+ require 'rubygems'
+end
version = ">= 0"
@@ -116,14 +116,16 @@ def remove_minigems!
if File.exists?(install_path = File.join(Gem::ConfigMap[:sitelibdir], 'minigems.rb'))
if FileUtils.rm(install_path)
puts "Succesfully removed #{install_path}"
- else
- puts "Could not remove #{install_path} (try sudo)"
+ return
end
end
+ rescue => e
+ puts e.message
+ puts "Could not remove #{install_path} (try sudo)"
end
def interpolate_wrapper(gem_name, executable_name, mode = 'minigems')
- @template_code ||= File.read(File.join(minigems_path, 'lib', 'minigems', 'executable_wrapper'))
+ @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['GEM_MODE'] = mode

0 comments on commit 8bc3e5f

Please sign in to comment.