Class: ZAWS::Command::Bucket

Inherits:
Thor
  • Object
show all
Defined in:
lib/zaws/command/bucket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Bucket

Returns a new instance of Bucket.



12
13
14
15
16
17
18
19
# File 'lib/zaws/command/bucket.rb', line 12

def initialize(*args)
  super
  shellout=ZAWS::Helper::Shell.new
  awscli = ZAWS::AWSCLI.new(shellout)
  @aws = ZAWS::AWS.new(shellout, awscli)
  @out = $stdout
  @print_exit_code = false
end

Instance Attribute Details

#awsObject

Returns the value of attribute aws.



8
9
10
# File 'lib/zaws/command/bucket.rb', line 8

def aws
  @aws
end

#outObject

Returns the value of attribute out.



9
10
11
# File 'lib/zaws/command/bucket.rb', line 9

def out
  @out
end

Returns the value of attribute print_exit_code.



10
11
12
# File 'lib/zaws/command/bucket.rb', line 10

def print_exit_code
  @print_exit_code
end

Instance Method Details

#declare(name) ⇒ Object



23
24
25
# File 'lib/zaws/command/bucket.rb', line 23

def declare(name)
  @aws.s3.bucket.declare(name, options[:region], @out)
end

#sync(bucket_name) ⇒ Object



30
31
32
# File 'lib/zaws/command/bucket.rb', line 30

def sync(bucket_name)
  @aws.s3.bucket.sync(options[:region], bucket_name, options[:dest])
end