Module: Uricp::CurlPrimitives
- Included in:
- Segmenter, Strategy::Common
- Defined in:
- lib/uricp/curl_primitives.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #authentication ⇒ Object
- #curl_command ⇒ Object
- #curl_download_to_pipe ⇒ Object
- #curl_manifest(object_manifest, destination = to) ⇒ Object
- #curl_upload_from(source, destination = to) ⇒ Object
- #from ⇒ Object
- #from=(target) ⇒ Object
- #http_authentication? ⇒ Boolean
- #to ⇒ Object
- #to=(target) ⇒ Object
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/uricp/curl_primitives.rb', line 4 def @options end |
Instance Method Details
#authentication ⇒ Object
26 27 28 |
# File 'lib/uricp/curl_primitives.rb', line 26 def authentication "-H X-Auth-Token:#{['authenticator'].call}" if http_authentication? end |
#curl_command ⇒ Object
22 23 24 |
# File 'lib/uricp/curl_primitives.rb', line 22 def curl_command 'curl --fail --silent' end |
#curl_download_to_pipe ⇒ Object
38 39 40 |
# File 'lib/uricp/curl_primitives.rb', line 38 def curl_download_to_pipe "#{curl_command} #{authentication} #{from} |" end |
#curl_manifest(object_manifest, destination = to) ⇒ Object
42 43 44 |
# File 'lib/uricp/curl_primitives.rb', line 42 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) ⇒ Object
34 35 36 |
# File 'lib/uricp/curl_primitives.rb', line 34 def curl_upload_from(source, destination = to) "#{curl_command} #{authentication} -T #{source} #{destination};" end |
#from ⇒ Object
6 7 8 |
# File 'lib/uricp/curl_primitives.rb', line 6 def from ['from_uri'] end |
#from=(target) ⇒ Object
10 11 12 |
# File 'lib/uricp/curl_primitives.rb', line 10 def from=(target) ['from_uri'] = target end |
#http_authentication? ⇒ Boolean
30 31 32 |
# File 'lib/uricp/curl_primitives.rb', line 30 def http_authentication? ['authenticator'] end |
#to ⇒ Object
14 15 16 |
# File 'lib/uricp/curl_primitives.rb', line 14 def to ['to_uri'] end |
#to=(target) ⇒ Object
18 19 20 |
# File 'lib/uricp/curl_primitives.rb', line 18 def to=(target) ['to_uri'] = target end |