# File bundler/cli/exec.rb, line 11 def initialize(options, args) @options = options @cmd = args.shift @args = args if Bundler.current_ruby.ruby_2? && !Bundler.current_ruby.jruby? @args << { :close_others => !options.keep_file_descriptors? } elsif options.keep_file_descriptors? Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec." end end
# File bundler/cli/exec.rb, line 23 def run validate_cmd! SharedHelpers.set_bundle_environment if bin_path = Bundler.which(cmd) if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path) return kernel_load(bin_path, *args) end # First, try to exec directly to something in PATH if Bundler.current_ruby.jruby_18? kernel_exec(bin_path, *args) else kernel_exec([bin_path, cmd], *args) end else # exec using the given command kernel_exec(cmd, *args) end end