lib/attached/storage/aws.rb in attached-0.1.8 vs lib/attached/storage/aws.rb in attached-0.1.9
- old
+ new
@@ -1,11 +1,11 @@
require 'attached/storage/base'
begin
require 'aws/s3'
rescue LoadError
- raise "Installation of 'aws/s3' is required before using 'aws' for storage"
+ raise "installation of 'aws/s3' is required before using 'aws' for storage"
end
module Attached
module Storage
@@ -55,12 +55,12 @@
def save(file, path)
connect()
begin
::AWS::S3::S3Object.store(path, file, bucket, :access => access)
- rescue AWS::S3::NoSuchBucket => e
- ::AWS::S3::Bucket.create(bucket)
+ rescue ::AWS::S3::NoSuchBucket => e
+ ::AWS::S3::Bucket.create(bucket)
retry
end
end
@@ -72,10 +72,10 @@
def destroy(path)
connect()
begin
::AWS::S3::S3Object.delete(path, bucket)
- rescue AWS::S3::NoSuchBucket => e
+ rescue ::AWS::S3::NoSuchBucket => e
end
end
private
\ No newline at end of file