stager/lib/vcap/stager/task.rb
# NB: We use curl here to avoid putting Ruby's GC on the data path.
We use curl here to avoid putting Ruby's GC on the data path.
We use curl here to avoid putting Ruby ' s GC on the data path .
def download_app(app_path)
    cfg_file = Tempfile.new("curl_dl_config")
    write_curl_config(@request["download_uri"], cfg_file.path,
                      "output" => app_path)
    res = @runner.run_logged("env -u http_proxy -u https_proxy curl -s -S -f -K #{cfg_file.path}")
    unless res[:status].success?
      raise VCAP::Stager::TaskError.new("Failed downloading app")
    end
    nil
  ensure
    cfg_file.unlink if cfg_file
  end
def download_app ( app_path ) cfg_file = Tempfile . new ( "curl_dl_config" ) write_curl_config ( @request [ "download_uri" ] , cfg_file . path , "output" => app_path ) res = @runner . run_logged ( "env -u http_proxy -u https_proxy curl -s -S -f -K #{cfg_file.path}" ) unless res [ :status ] . success? raise VCAP :: Stager :: TaskError . new ( "Failed downloading app" ) end nil ensure cfg_file . unlink if cfg_file end
NB: We use curl here to avoid putting Ruby's GC on the data path.
NB : We use curl here to avoid putting Ruby ' s GC on the data path .
# Show errors but not progress, fail on non-200
app_path