Class: AwsS3Export::Export
- Inherits:
-
Object
- Object
- AwsS3Export::Export
- Defined in:
- lib/aws_s3_export/export.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Export
constructor
A new instance of Export.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/aws_s3_export/export.rb', line 8 def run set_config # Create the basic S3 object @s3 = AWS::S3.new # Load up the 'bucket' we want to store things in @bucket = @s3.buckets[@config.bucket_name] # If the bucket doesn't exist, create it unless @bucket.exists? puts "Need to make bucket #{@config.bucket_name}.." @s3.buckets.create(@config.bucket_name) end Dir.entries(@config.export_dir).each do |dir_or_file| puts "Work in #{dir_or_file}" save_file_or_dir(dir_or_file) end end |