Sha256: d43619dbdc46c270a021fc523adcb9b3e2f877b8aac0316bfa807b3f4301fb83
Contents?: true
Size: 781 Bytes
Versions: 2
Compression:
Stored size: 781 Bytes
Contents
require 'open-uri' module Uricp::Strategy class PipedRemoteGet include Uricp::Strategy::Common def appropriate? case from.scheme when 'http', 'https' return proposal unless sequence_complete? else debug "#{self.class.name}: not appropriate" false end end alias :command :curl_download_to_pipe def proposal @proposed_options = options.dup @proposed_options['from_uri'] = PIPE_URI if options['target-format'] @proposed_options['source-format'] = options['from_uri'].open(headers) { |u| encoding(u) } end self end def headers headers={'Range' => 'bytes=0-7'} headers['X-Auth-Token'] = options['auth-token'] if http_authentication? headers end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
uricp-0.0.2 | lib/uricp/strategy/piped_remote_get.rb |
uricp-0.0.1 | lib/uricp/strategy/piped_remote_get.rb |