Sha256: 0c80b8e2cc5595a3ab5dbb398e906f3724c87517435fcb1969d7ea63c143137b

Contents?: true

Size: 515 Bytes

Versions: 7

Compression:

Stored size: 515 Bytes

Contents

module Microstatic

class S3BucketCreator
  include UsesFog

  def initialize( aws_creds )
    check_and_store_aws_creds(aws_creds)
  end

  def create( bucket_name )
    # TODO: can we create a new directory without eagerly fetch the list of all dirs?
    directory = connection.directories.create( :key => bucket_name, :public => true )
    # TODO: can I do this by calling a method on directory? 
    connection.put_bucket_website( directory.key, 'index.html', :key => '404.html' )

    directory
  end
end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
microstatic-0.6.0 lib/microstatic/s3_bucket_creator.rb
microstatic-0.5.2 lib/microstatic/s3_bucket_creator.rb
microstatic-0.5.1 lib/microstatic/s3_bucket_creator.rb
microstatic-0.5.0 lib/microstatic/s3_bucket_creator.rb
microstatic-0.4.2 lib/microstatic/s3_bucket_creator.rb
microstatic-0.4.1 lib/microstatic/s3_bucket_creator.rb
microstatic-0.4.0 lib/microstatic/s3_bucket_creator.rb