Advertisement
RodneyRodGrip

Untitled

Mar 26th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. require 'rbconfig'
  2. config = defined?(RbConfig) ? RbConfig : Config
  3.  
  4. ruby = File.join config::CONFIG['bindir'], config::CONFIG['ruby_install_name']
  5. ruby << config::CONFIG['EXEEXT']
  6.  
  7. cmd = [ruby, 'setup.rb', *ARGV].compact
  8. cmd[1,0] = "--disable-gems"
  9.  
  10. exec(*cmd)
  11. end
  12.  
  13. Dir.chdir File.dirname(__FILE__)
  14.  
  15. $:.unshift 'lib'
  16. require 'rubygems'
  17. require 'rubygems/gem_runner'
  18. require 'rubygems/exceptions'
  19.  
  20. Gem::CommandManager.instance.register_command :setup
  21.  
  22. args = ARGV.clone
  23. if ENV["GEM_PREV_VER"]
  24. args = [ '--previous-version', ENV["GEM_PREV_VER"] ] + args
  25. end
  26. args.unshift 'setup'
  27.  
  28. begin
  29. Gem::GemRunner.new.run args
  30. rescue Gem::SystemExitException => e
  31. exit e.exit_code
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement