Class: S3Ranger::CLI::ListBuckets

Inherits:
BaseCmd
  • Object
show all
Defined in:
lib/s3ranger/cli.rb

Instance Method Summary collapse

Methods inherited from BaseCmd

#has_options?, #has_prefix?, #usage

Constructor Details

#initializeListBuckets

Returns a new instance of ListBuckets.



68
69
70
71
72
# File 'lib/s3ranger/cli.rb', line 68

def initialize
  super 'listbuckets', false, false, false

  @short_desc = "List all available buckets for your user"
end

Instance Method Details

#run(s3, bucket, key, file, args) ⇒ Object



74
75
76
77
78
# File 'lib/s3ranger/cli.rb', line 74

def run s3, bucket, key, file, args
  s3.buckets.each do |bkt|
    puts "#{bkt.name}"
  end
end