Sha256: a024346db2795d2899cc30677afc7542fcb43ef4f8dc15c063abc3c2d03c47bd
Contents?: true
Size: 730 Bytes
Versions: 11
Compression:
Stored size: 730 Bytes
Contents
module Opener module Daemons ## # Downloads and validates text/XML documents used as input. # # @!attribute [r] http # @return [HTTPClient] # class Downloader attr_reader :http def initialize @http = HTTPClient.new end ## # Downloads the document located at `url`. # # @param [String] url # @return [String] # def download(url) resp = http.get(url, :follow_redirect => true) unless resp.ok? raise( HTTPClient::BadResponseError, "Got HTTP #{resp.status}: #{resp.body}" ) end return resp.body end end # Downloader end # Daemons end # Opener
Version data entries
11 entries across 11 versions & 1 rubygems