Class: AwsTestDump::S3FileRestore
Instance Attribute Summary
#bucket_name, #key_name
Instance Method Summary
collapse
#initialize
Instance Method Details
#file_contents ⇒ Object
125
126
127
128
129
130
|
# File 'lib/aws_test_dump.rb', line 125
def file_contents
if @file_contents.nil?
@file_contents = File.read(@dump_file)
end
@file_contents
end
|
#restore ⇒ Object
132
133
134
135
|
# File 'lib/aws_test_dump.rb', line 132
def restore
@s3_client.create_bucket({bucket: @bucket_name})
@s3_client.put_object({bucket: @bucket_name, key: @key_name, body: file_contents})
end
|
#run ⇒ Object
121
122
123
|
# File 'lib/aws_test_dump.rb', line 121
def run
restore
end
|