mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[local|storage] properly write out file contents
This commit is contained in:
parent
492f960ff0
commit
73f5fdf9e7
1 changed files with 5 additions and 1 deletions
|
@ -45,7 +45,11 @@ module Fog
|
|||
def save(options = {})
|
||||
requires :body, :directory, :key
|
||||
file = ::File.new(path, 'w')
|
||||
file.write(body)
|
||||
if body.is_a?(String)
|
||||
file.write(body)
|
||||
else
|
||||
file.write(body.read)
|
||||
end
|
||||
file.close
|
||||
merge_attributes(
|
||||
:content_length => ::File.size(path),
|
||||
|
|
Loading…
Reference in a new issue