Class: LiquidBackup::Handler::S3
- Inherits:
-
Object
- Object
- LiquidBackup::Handler::S3
- Defined in:
- lib/liquid_backup/handler/s3.rb
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(options = {}) ⇒ S3
constructor
A new instance of S3.
- #store(location, files = []) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ S3
Returns a new instance of S3.
6 7 8 |
# File 'lib/liquid_backup/handler/s3.rb', line 6 def initialize(={}) AWS::S3::Base.establish_connection!(:access_key_id => [:access_key_id], :secret_access_key => [:secret_access_key]) end |
Instance Method Details
#cleanup ⇒ Object
21 22 23 |
# File 'lib/liquid_backup/handler/s3.rb', line 21 def cleanup # Nothing here yet end |
#store(location, files = []) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/liquid_backup/handler/s3.rb', line 10 def store(location, files = []) return false unless files.any? AWS::S3::Bucket.create(location) files.each do |file| AWS::S3::S3Object.store("#{File.mtime(file).strftime("%Y%m%d%H%M%S")}_#{File.split(file)[-1]}", File.open(file), location) end self end |