Sha256: db33f3e6168ee753c4f6d832597810e19ced811ae717adcf304835d4f8a298de

Contents?: true

Size: 1.16 KB

Versions: 25

Compression:

Stored size: 1.16 KB

Contents


module Rudy; module CLI; 
module AWS; module S3;
  
  class Buckets < Rudy::CLI::CommandBase
    
    
    def buckets
      raise "No bucket name supplied" if !@argv.name && @option.list
      s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region)
      unless @option.list
        (s3.list_buckets || []).each do |b|
          puts b.name
        end
      else
        puts "All objects in #{@argv.name}:"
        (s3.list_bucket_objects(@argv.name) || []).each do |o|
          puts o
        end
      end
    end
    
    def create_buckets_valid?
      raise "No bucket name supplied" unless @argv.name
      true
    end
    def create_buckets
      execute_check(:low)
      s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region)
      s3.create_bucket(@argv.name)
      buckets
    end
    
    def destroy_buckets_valid?
      raise "No bucket name supplied" unless @argv.name
      true
    end
    def destroy_buckets
      execute_check(:medium)
      s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region)
      s3.destroy_bucket(@argv.name)
      buckets
    end
    
    
  end
  
end; end
end; end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
solutious-rudy-0.6.0 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.1 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.2 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.3 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.4 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.5 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.6 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.7 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.6.8 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.0 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.1 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.2 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.3 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.6.2 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.6.0 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.6.1 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.6.4 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.6.5 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.6.3 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.7.0 lib/rudy/cli/aws/s3/buckets.rb