Sha256: fabcf2748bb27aefe997beb7c5d01c814d23aefd4f215e17f23aaccf317f846f

Contents?: true

Size: 323 Bytes

Versions: 2

Compression:

Stored size: 323 Bytes

Contents

module Crags
  module Fetcher
    def fetch_doc(url)
      Nokogiri::XML.parse(fetch_xml(url))
    end

    def fetch_xml(url)
      req = fetch_request(url)
      req.body_str
    end

    def fetch_request(url)
      req = Curl::Easy.new(url)
      req.follow_location = true
      req.perform
      req
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crags-2.2.1 lib/crags/fetcher.rb
crags-2.2.0 lib/crags/fetcher.rb