Flowdock
method

run

Importance_0
v2_4_6 - Show latest stable - 0 notes - Class: Builder
run(command, results, command_name = nil) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/ext/builder.rb, line 63
  def self.run(command, results, command_name = nil)
    verbose = Gem.configuration.really_verbose

    begin
      # TODO use Process.spawn when ruby 1.8 support is dropped.
      rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], nil
      if verbose
        puts("current directory: #{Dir.pwd}")
        puts(command)
        system(command)
      else
        results << "current directory: #{Dir.pwd}"
        results << command
        results << `#{command} #{redirector}`
      end
    ensure
      ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
    end

    unless $?.success? then
      results << "Building has failed. See above output for more information on the failure." if verbose

      exit_reason =
        if $?.exited? then
          ", exit code #{$?.exitstatus}"
        elsif $?.signaled? then
          ", uncaught signal #{$?.termsig}"
        end

      raise Gem::InstallError, "#{command_name || class_name} failed#{exit_reason}"
    end
  end
Register or log in to add new notes.