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.



77
78
79
80
81
# File 'lib/s3ranger/cli.rb', line 77

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



83
84
85
86
87
# File 'lib/s3ranger/cli.rb', line 83

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