method
run

v2_6_3 -
Show latest stable
-
0 notes -
Class: Builder
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
run(command, results, command_name = nil)
public
Hide source
# File lib/rubygems/ext/builder.rb, line 63 def self.run(command, results, command_name = nil) verbose = Gem.configuration.really_verbose begin rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], nil if verbose puts("current directory: #{Dir.pwd}") p(command) end results << "current directory: #{Dir.pwd}" results << (command.respond_to?(:shelljoin) ? command.shelljoin : command) redirections = verbose ? {} : {err: [:child, :out]} IO.popen(command, "r", redirections) do |io| if verbose IO.copy_stream(io, $stdout) else results << io.read end end rescue => error raise Gem::InstallError, "#{command_name || class_name} failed#{error.message}" ensure ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps end unless $?.success? results << "Building has failed. See above output for more information on the failure." if verbose exit_reason = if $?.exited? ", exit code #{$?.exitstatus}" elsif $?.signaled? ", uncaught signal #{$?.termsig}" end raise Gem::InstallError, "#{command_name || class_name} failed#{exit_reason}" end end