mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|storage] Added ability to control bucket versioning from Directory model.
This commit is contained in:
parent
28df463458
commit
2d084c7844
1 changed files with 11 additions and 0 deletions
|
@ -58,6 +58,17 @@ module Fog
|
|||
@payer = new_payer
|
||||
end
|
||||
|
||||
def versioning?
|
||||
requires :key
|
||||
data = connection.get_bucket_versioning(key)
|
||||
data.body['VersioningConfiguration']['Status'] == 'Enabled'
|
||||
end
|
||||
|
||||
def versioning=(new_versioning)
|
||||
requires :key
|
||||
connection.put_bucket_versioning(key, new_versioning ? 'Enabled' : 'Suspended')
|
||||
end
|
||||
|
||||
def public=(new_public)
|
||||
if new_public
|
||||
@acl = 'public-read'
|
||||
|
|
Loading…
Reference in a new issue