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.
3 4 5 |
# File 'lib/uricp/curl_primitives.rb', line 3 def @options end |
Instance Method Details
#authentication ⇒ Object
25 26 27 |
# File 'lib/uricp/curl_primitives.rb', line 25 def authentication "-H X-Auth-Token:#{['authenticator'].call}" if http_authentication? end |
#curl_command ⇒ Object
21 22 23 |
# File 'lib/uricp/curl_primitives.rb', line 21 def curl_command "curl --fail --silent" end |
#curl_download_to_pipe ⇒ Object
37 38 39 |
# File 'lib/uricp/curl_primitives.rb', line 37 def curl_download_to_pipe "#{curl_command} #{authentication} #{from.to_s} |" end |
#curl_manifest(object_manifest, destination = to) ⇒ Object
41 42 43 |
# File 'lib/uricp/curl_primitives.rb', line 41 def curl_manifest(object_manifest, destination = to) "#{curl_command} #{authentication} -X PUT -H 'X-Object-Manifest: #{object_manifest}' #{destination.to_s} --data-binary ''" end |
#curl_upload_from(source, destination = to) ⇒ Object
33 34 35 |
# File 'lib/uricp/curl_primitives.rb', line 33 def curl_upload_from(source, destination = to) "#{curl_command} #{authentication} -T #{source} #{destination.to_s};" end |
#from ⇒ Object
5 6 7 |
# File 'lib/uricp/curl_primitives.rb', line 5 def from ['from_uri'] end |
#from=(target) ⇒ Object
9 10 11 |
# File 'lib/uricp/curl_primitives.rb', line 9 def from=(target) ['from_uri'] = target end |
#http_authentication? ⇒ Boolean
29 30 31 |
# File 'lib/uricp/curl_primitives.rb', line 29 def http_authentication? ['authenticator'] end |
#to ⇒ Object
13 14 15 |
# File 'lib/uricp/curl_primitives.rb', line 13 def to ['to_uri'] end |
#to=(target) ⇒ Object
17 18 19 |
# File 'lib/uricp/curl_primitives.rb', line 17 def to=(target) ['to_uri'] = target end |