class Uricp::Strategy::RemotePut

Public Instance Methods

appropriate?() click to toggle source
# File lib/uricp/strategy/remote_put.rb, line 5
def appropriate?
  if compression_required? || conversion_required?
    debug "#{self.class.name}: not ready to upload"
    return false
  end
  case to.scheme
  when 'http', 'https'
    case from.scheme
    when 'file', 'pipe'
      return proposal if http_authentication?

      unsupported_transfer
    end
  end
  debug "#{self.class.name}: not appropriate"
  false
end
command() click to toggle source
# File lib/uricp/strategy/remote_put.rb, line 23
def command
  curl_upload_from(curl_source)
end
curl_source() click to toggle source
# File lib/uricp/strategy/remote_put.rb, line 33
def curl_source
  if from.scheme == 'pipe'
    '-'
  else
    from.path
  end
end
proposal() click to toggle source
# File lib/uricp/strategy/remote_put.rb, line 27
def proposal
  @proposed_options = options.dup
  @proposed_options['from_uri'] = to
  self
end