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 => e if on_failure == :null @data = {} else raise e end end end end end