lib/cloud_crowd/action.rb
# Download a file to the specified path.
Download a file to the specified path.
Download a file to the specified path .
def download(url, path)
      `curl -s "{url}" > "{path}"`
      return path
       if url.match(FILE_URL)
         FileUtils.cp(url.sub(FILE_URL, ''), path)
       else
         resp = RestClient::Request.execute(:url => url, :method => :get, :raw_response => true)
         FileUtils.mv resp.file.path, path
       end
    end
def download ( url , path ) ` curl -s " #{ url } " > " #{ path } " ` return path end
Download a file to the specified path.
Download a file to the specified path .
# The previous implementation is below, and, although it would be  # wonderful not to shell out, RestClient wasn't handling URLs with encoded # entities (%20, for example), and doesn't let you download to a given # location. Getting a RestClient patch in would be ideal. # # if url.match(FILE_URL) #   FileUtils.cp(url.sub(FILE_URL, ''), path) # else #   resp = RestClient::Request.execute(:url => url, :method => :get, :raw_response => true) #   FileUtils.mv resp.file.path, path # end
url
<not_specific>
path
<not_specific>