Sha256: 6dd702207bb2b657cea8a41ce20de65c59512ae3db37219feb27408f63b254bc
Contents?: true
Size: 632 Bytes
Versions: 31
Compression:
Stored size: 632 Bytes
Contents
module EbDeployer class S3Driver def create_bucket(bucket_name) buckets.create(bucket_name) end def bucket_exists?(bucket_name) buckets[bucket_name].exists? end def object_length(bucket_name, obj_name) obj(bucket_name, obj_name).content_length rescue nil end def upload_file(bucket_name, obj_name, file) o = obj(bucket_name, obj_name) File.open(file) { |f| o.write(f) } end private def s3 AWS::S3.new end def obj(bucket_name, obj_name) buckets[bucket_name].objects[obj_name] end def buckets s3.buckets end end end
Version data entries
31 entries across 31 versions & 1 rubygems