forked from rubygems/rubygems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.rb
36 lines (26 loc) · 780 Bytes
/
setup.rb
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
# frozen_string_literal: true
#--
# Copyright 2006, 2007 by Chad Fowler, Rich Kilmer, Jim Weirich, Eric Hodel
# and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
abort "RubyGems only supports Ruby 3.0 or higher" if RUBY_VERSION < "3.0.0"
# Make sure rubygems isn't already loaded.
if ENV["RUBYOPT"] || defined? Gem
ENV.delete "RUBYOPT"
require "rbconfig"
cmd = [RbConfig.ruby, "--disable-gems", "setup.rb", *ARGV]
exec(*cmd)
end
Dir.chdir __dir__
$:.unshift File.expand_path("lib")
require "rubygems"
require "rubygems/gem_runner"
Gem::CommandManager.instance.register_command :setup
args = ARGV.clone
if ENV["GEM_PREV_VER"]
args = ["--previous-version", ENV["GEM_PREV_VER"]] + args
end
args.unshift "setup"
Gem::GemRunner.new.run args