public
Fork of vvs/rubygems
Description: Unofficial Git mirror of the main RubyGems repository
Homepage: http://docs.rubygems.org/
Clone URL: git://github.com/wycats/rubygems.git
rubygems / setup.rb
100644 40 lines (28 sloc) 0.813 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#--
# Copyright 2006, 2007 by Chad Fowler, Rich Kilmer, Jim Weirich, Eric Hodel
# and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
 
# Make sure rubygems isn't already loaded.
if ENV['RUBYOPT'] and defined? Gem then
  ENV.delete 'RUBYOPT'
 
  require 'rbconfig'
  config = defined?(RbConfig) ? RbConfig : Config
 
  ruby = File.join config::CONFIG['bindir'], config::CONFIG['ruby_install_name']
  ruby << config::CONFIG['EXEEXT']
 
  exec(ruby, 'setup.rb', *ARGV)
end
 
Dir.chdir File.dirname(__FILE__)
 
$:.unshift 'lib'
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
 
Gem::CommandManager.instance.register_command :setup
 
args = ARGV.clone
 
args.unshift 'setup'
 
begin
  Gem::GemRunner.new.run args
rescue Gem::SystemExitException => e
  exit e.exit_code
end