Skip to content

Commit

Permalink
Small fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien committed Sep 19, 2008
1 parent a298afb commit 8bc3e5f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -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}"

Expand Down
1 change: 0 additions & 1 deletion bin/minigem
Expand Up @@ -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]"
Expand Down
2 changes: 1 addition & 1 deletion lib/minigems.rb
@@ -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.
Expand Down
6 changes: 5 additions & 1 deletion lib/minigems/executable_wrapper
Expand Up @@ -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"

Expand Down
8 changes: 5 additions & 3 deletions lib/minigems/script_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 8bc3e5f

Please sign in to comment.