Class: S3Secure::CLI::Batch

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/s3_secure/cli/batch.rb

Instance Method Summary collapse

Constructor Details

#initialize(*params) ⇒ Batch

Returns a new instance of Batch.



5
6
7
8
# File 'lib/s3_secure/cli/batch.rb', line 5

def initialize(*params)
  @params = params
  @command, @subcommand, @file = params
end

Instance Method Details

#bucketsObject



20
21
22
# File 'lib/s3_secure/cli/batch.rb', line 20

def buckets
  IO.readlines(@file).map(&:strip).reject(&:empty?)
end

#runObject



10
11
12
13
14
15
16
17
18
# File 'lib/s3_secure/cli/batch.rb', line 10

def run
  buckets.each do |bucket|
    args = @params
    args.pop
    args << bucket
    puts "Running: s3-secure #{args.join(' ')}".color(:green)
    S3Secure::CLI.start(args)
  end
end