Sha256: abfa3331cd73098ae941524683c80f6e821ed5578e4e78f013e6252806899a61

Contents?: true

Size: 749 Bytes

Versions: 96

Compression:

Stored size: 749 Bytes

Contents

module S3String
  def bucket_objects
    AWS::S3::Bucket.objects(self)
  end
  def bucket_object(key)
    AWS::S3::S3Object.value key, self if bucket_object_exists?(key)
  end
  def bucket_object_exists?(key)
    AWS::S3::S3Object.exists? key, self
  end
  def store_bucket_value(key, data)
    AWS::S3::S3Object.store key, data, self unless bucket_object_exists?(key)
  end
  def delete_bucket_value(key)
    AWS::S3::S3Object.delete(key, self) if bucket_object_exists?(key)
  end
  def bucket_exists?
    begin
      AWS::S3::Bucket.find(self)
      return true
    rescue
      return false
    end        
  end
  def delete_bucket
    AWS::S3::Bucket.delete(self, :force => true) if bucket_exists?
  end
end

class String
  include S3String
end

Version data entries

96 entries across 96 versions & 3 rubygems

Version Path
auser-poolparty-0.2.15 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.16 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.2 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.20 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.21 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.22 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.23 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.24 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.25 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.26 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.3 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.35 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.36 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.37 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.38 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.39 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.4 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.40 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.41 lib/poolparty/modules/s3_string.rb
auser-poolparty-0.2.42 lib/poolparty/modules/s3_string.rb