Class: ZAWS::Command::Bucket
- Inherits:
-
Thor
- Object
- Thor
- ZAWS::Command::Bucket
- Defined in:
- lib/zaws/command/bucket.rb
Instance Attribute Summary collapse
-
#aws ⇒ Object
Returns the value of attribute aws.
-
#out ⇒ Object
Returns the value of attribute out.
-
#print_exit_code ⇒ Object
Returns the value of attribute print_exit_code.
Instance Method Summary collapse
- #declare(name) ⇒ Object
-
#initialize(*args) ⇒ Bucket
constructor
A new instance of Bucket.
- #sync(bucket_name) ⇒ Object
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
#aws ⇒ Object
Returns the value of attribute aws.
8 9 10 |
# File 'lib/zaws/command/bucket.rb', line 8 def aws @aws end |
#out ⇒ Object
Returns the value of attribute out.
9 10 11 |
# File 'lib/zaws/command/bucket.rb', line 9 def out @out end |
#print_exit_code ⇒ Object
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, [: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([:region], bucket_name, [:dest]) end |