module Uricp::CurlPrimitives

Attributes

options[R]

Public Instance Methods

authentication() click to toggle source
# File lib/uricp/curl_primitives.rb, line 24
def authentication
  "-H X-Auth-Token:#{options['authenticator'].call}" if http_authentication?
end
curl_command() click to toggle source
# File lib/uricp/curl_primitives.rb, line 20
def curl_command
  'curl --fail --silent'
end
curl_download_to_pipe() click to toggle source
# File lib/uricp/curl_primitives.rb, line 36
def curl_download_to_pipe
  "#{curl_command} #{authentication} #{from} |"
end
curl_manifest(object_manifest, destination = to) click to toggle source
# File lib/uricp/curl_primitives.rb, line 40
def curl_manifest(object_manifest, destination = to)
  "#{curl_command} #{authentication} -X PUT -H 'X-Object-Manifest: #{object_manifest}' #{destination} --data-binary ''"
end
curl_upload_from(source, destination = to) click to toggle source
# File lib/uricp/curl_primitives.rb, line 32
def curl_upload_from(source, destination = to)
  "#{curl_command} #{authentication} -T #{source} #{destination};"
end
from() click to toggle source
# File lib/uricp/curl_primitives.rb, line 4
def from
  options['from_uri']
end
from=(target) click to toggle source
# File lib/uricp/curl_primitives.rb, line 8
def from=(target)
  options['from_uri'] = target
end
http_authentication?() click to toggle source
# File lib/uricp/curl_primitives.rb, line 28
def http_authentication?
  options['authenticator']
end
to() click to toggle source
# File lib/uricp/curl_primitives.rb, line 12
def to
  options['to_uri']
end
to=(target) click to toggle source
# File lib/uricp/curl_primitives.rb, line 16
def to=(target)
  options['to_uri'] = target
end