Sha256: 88dd7233f66a141b165343391379556e2ac79be7675b668b297d6c6d02c87173

Contents?: true

Size: 1.16 KB

Versions: 54

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
      s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region)
      s3.create_bucket(@argv.name, @option.location)
      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

54 entries across 54 versions & 3 rubygems

Version Path
sabat-rudy-0.8.0 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.4 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.5 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.7.6 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.8.0 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.8.1 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.8.2 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.8.3 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.8.4 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.8.5 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.9.0 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.9.1 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.9.2 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.9.3 lib/rudy/cli/aws/s3/buckets.rb
solutious-rudy-0.9.4 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.9.8.020 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.9.8.019 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.9.8.018 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.9.8.017 lib/rudy/cli/aws/s3/buckets.rb
rudy-0.9.8.016 lib/rudy/cli/aws/s3/buckets.rb