Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 45 lines (33 sloc) 0.978 kB
f9b95a4 @drbrain Gem::ruby now returns the full path. Added Gem::prefix to make self …
drbrain authored
1 #--
2 # Copyright 2006, 2007 by Chad Fowler, Rich Kilmer, Jim Weirich, Eric Hodel
3 # and others.
4 # All rights reserved.
5 # See LICENSE.txt for permissions.
6 #++
228a380 @chad Changing to setup.rb. Needs testing!
chad authored
7
300b243 @drbrain Unset RUBYOPT when installing. Fixes bug #14683 submitted by Lyle Jo…
drbrain authored
8 # Make sure rubygems isn't already loaded.
0be4d61 @zenspider - setup.rb now execs with --disable-gems when possible
zenspider authored
9 if ENV['RUBYOPT'] or defined? Gem then
300b243 @drbrain Unset RUBYOPT when installing. Fixes bug #14683 submitted by Lyle Jo…
drbrain authored
10 ENV.delete 'RUBYOPT'
11
f87527b @drbrain Fix Apple-RubyGems update (and updates for embedded RubyGems).
drbrain authored
12 require 'rbconfig'
13 config = defined?(RbConfig) ? RbConfig : Config
14
15 ruby = File.join config::CONFIG['bindir'], config::CONFIG['ruby_install_name']
16 ruby << config::CONFIG['EXEEXT']
300b243 @drbrain Unset RUBYOPT when installing. Fixes bug #14683 submitted by Lyle Jo…
drbrain authored
17
0be4d61 @zenspider - setup.rb now execs with --disable-gems when possible
zenspider authored
18 cmd = [ruby, 'setup.rb', *ARGV].compact
19 cmd[1,0] = "--disable-gems" if RUBY_VERSION > "1.9"
20
21 exec(*cmd)
300b243 @drbrain Unset RUBYOPT when installing. Fixes bug #14683 submitted by Lyle Jo…
drbrain authored
22 end
23
7eac773 @drbrain Ensure we're in RubyGems at install time
drbrain authored
24 Dir.chdir File.dirname(__FILE__)
25
f9b95a4 @drbrain Gem::ruby now returns the full path. Added Gem::prefix to make self …
drbrain authored
26 $:.unshift 'lib'
27 require 'rubygems'
96a6059 @drbrain Move setup.rb guts to lib/rubygems/commands/setup_command.rb
drbrain authored
28 require 'rubygems/gem_runner'
29 require 'rubygems/exceptions'
7a319d4 @drbrain Patch #20610, gemspec backwards compatibility, installed location for…
drbrain authored
30
96a6059 @drbrain Move setup.rb guts to lib/rubygems/commands/setup_command.rb
drbrain authored
31 Gem::CommandManager.instance.register_command :setup
7a319d4 @drbrain Patch #20610, gemspec backwards compatibility, installed location for…
drbrain authored
32
96a6059 @drbrain Move setup.rb guts to lib/rubygems/commands/setup_command.rb
drbrain authored
33 args = ARGV.clone
6d593d1 Prototype of update_rubygems "smart" history playback.
Erik Hollensbe authored
34 if ENV["GEM_PREV_VER"]
35 args = [ '--previous-version', ENV["GEM_PREV_VER"] ] + args
36 end
96a6059 @drbrain Move setup.rb guts to lib/rubygems/commands/setup_command.rb
drbrain authored
37 args.unshift 'setup'
7a319d4 @drbrain Patch #20610, gemspec backwards compatibility, installed location for…
drbrain authored
38
96a6059 @drbrain Move setup.rb guts to lib/rubygems/commands/setup_command.rb
drbrain authored
39 begin
40 Gem::GemRunner.new.run args
41 rescue Gem::SystemExitException => e
42 exit e.exit_code
7a319d4 @drbrain Patch #20610, gemspec backwards compatibility, installed location for…
drbrain authored
43 end
2e8c2a5 @drbrain Remove source caches on install
drbrain authored
44
Something went wrong with that request. Please try again.