mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[s3] fix deprecated directory#name usage
This commit is contained in:
parent
877a7bcf7f
commit
e1740eac4e
2 changed files with 9 additions and 9 deletions
|
@ -29,10 +29,10 @@ module Fog
|
|||
@directory
|
||||
end
|
||||
|
||||
def copy(target_directory_name, target_file_key)
|
||||
def copy(target_directory_key, target_file_key)
|
||||
requires :directory, :key
|
||||
data = connection.copy_object(directory.name, @key, target_directory_name, target_file_key).body
|
||||
target_directory = connection.directories.new(:name => target_directory_name)
|
||||
data = connection.copy_object(directory.key, @key, target_directory_key, target_file_key).body
|
||||
target_directory = connection.directories.new(:key => target_directory_key)
|
||||
target_file = target_directory.files.new(attributes.merge!(:key => target_file_key))
|
||||
copy_data = {}
|
||||
for key, value in data
|
||||
|
@ -46,7 +46,7 @@ module Fog
|
|||
|
||||
def destroy
|
||||
requires :directory, :key
|
||||
connection.delete_object(directory.name, @key)
|
||||
connection.delete_object(directory.key, @key)
|
||||
true
|
||||
end
|
||||
|
||||
|
@ -61,7 +61,7 @@ module Fog
|
|||
|
||||
def save(options = {})
|
||||
requires :body, :directory, :key
|
||||
data = connection.put_object(directory.name, @key, @body, options)
|
||||
data = connection.put_object(directory.key, @key, @body, options)
|
||||
@etag = data.headers['ETag']
|
||||
true
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ module Fog
|
|||
options = options.reject {|key,value| value.nil? || value.to_s.empty?}
|
||||
merge_attributes(options)
|
||||
parent = directory.collection.get(
|
||||
directory.name,
|
||||
directory.key,
|
||||
options
|
||||
)
|
||||
if parent
|
||||
|
@ -37,7 +37,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(key, options = {}, &block)
|
||||
data = connection.get_object(directory.name, key, options, &block)
|
||||
data = connection.get_object(directory.key, key, options, &block)
|
||||
file_data = {
|
||||
:body => data.body,
|
||||
:key => key
|
||||
|
@ -53,11 +53,11 @@ module Fog
|
|||
end
|
||||
|
||||
def get_url(key, expires)
|
||||
connection.get_object_url(directory.name, key, expires)
|
||||
connection.get_object_url(directory.key, key, expires)
|
||||
end
|
||||
|
||||
def head(key, options = {})
|
||||
data = connection.head_object(directory.name, key, options)
|
||||
data = connection.head_object(directory.key, key, options)
|
||||
file_data = {
|
||||
:key => key
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue