diff --git a/lib/vos/drivers/s3.rb b/lib/vos/drivers/s3.rb index 62ce11b..36aa181 100644 --- a/lib/vos/drivers/s3.rb +++ b/lib/vos/drivers/s3.rb @@ -10,7 +10,7 @@ class S3 def initialize options = {} options = options.clone @bucket_name = options.delete(:bucket) || raise("S3 bucket not provided!") - @acl = options.delete(:acl) || :public_read + @write_options = {:acl => :public_read}.merge(options.delete(:write_options)) @options = options end @@ -57,7 +57,7 @@ def _clear end protected - attr_reader :options, :bucket_name, :acl + attr_reader :options, :bucket_name, :write_options end end -end \ No newline at end of file +end diff --git a/lib/vos/drivers/s3_vfs_storage.rb b/lib/vos/drivers/s3_vfs_storage.rb index 283bedb..aefef03 100644 --- a/lib/vos/drivers/s3_vfs_storage.rb +++ b/lib/vos/drivers/s3_vfs_storage.rb @@ -58,11 +58,11 @@ def write_file original_path, append, &block writer = Writer.new writer.write file.read if file.exists? block.call writer - file.write writer.data, acl: acl + file.write writer.data, write_options else writer = Writer.new block.call writer - file.write writer.data, acl: acl + file.write writer.data, write_options end end @@ -144,4 +144,4 @@ def normalize_path path end end end -end \ No newline at end of file +end