Sha256: 19413f76bf5114d087055de2b7441d496c909d3ff02cf787a286c3883a920012
Contents?: true
Size: 561 Bytes
Versions: 7
Compression:
Stored size: 561 Bytes
Contents
require 'net/http' module Pears module Provider # Fetch a yaml file via HTTP class RemoteFile < Base def initialize(remote_url, on_failure: :raise) yaml_data = Net::HTTP.get(URI(remote_url)) @data = parse_yaml(yaml_data) rescue SocketError, InvalidProviderData, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::EADDRNOTAVAIL, Net::OpenTimeout => e if on_failure == :null @data = {} else raise e end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems