2010-03-19 18:29:42 -07:00
|
|
|
module Fog
|
|
|
|
module Rackspace
|
|
|
|
module Files
|
|
|
|
class Real
|
2009-10-31 10:59:50 -07:00
|
|
|
|
|
|
|
# Create a new object
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * container<~String> - Name for container, should be < 256 bytes and must not contain '/'
|
|
|
|
#
|
|
|
|
def put_object(container, object, data)
|
2010-03-19 18:29:42 -07:00
|
|
|
data = Fog::Rackspace::Files.parse_data(data)
|
2009-10-31 10:59:50 -07:00
|
|
|
response = storage_request(
|
|
|
|
:body => data[:body],
|
|
|
|
:expects => 201,
|
2009-11-03 21:46:27 -08:00
|
|
|
:headers => data[:headers],
|
2009-10-31 10:59:50 -07:00
|
|
|
:method => 'PUT',
|
|
|
|
:path => "#{CGI.escape(container)}/#{CGI.escape(object)}"
|
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2010-03-19 18:29:42 -07:00
|
|
|
class Mock
|
2009-10-31 10:59:50 -07:00
|
|
|
|
2010-02-01 22:53:18 -08:00
|
|
|
def put_object(container, object, data)
|
|
|
|
raise MockNotImplemented.new("Contributions welcome!")
|
2009-10-31 10:59:50 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|