Class: S3Batch::Upload
- Inherits:
-
Object
- Object
- S3Batch::Upload
- Defined in:
- lib/s3batch/batch_upload.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bucket, dir, pattern, options = {}) ⇒ Upload
constructor
A new instance of Upload.
- #upload(request_options = {}) ⇒ Object
Constructor Details
#initialize(bucket, dir, pattern, options = {}) ⇒ Upload
Returns a new instance of Upload.
25 26 27 28 29 30 |
# File 'lib/s3batch/batch_upload.rb', line 25 def initialize(bucket, dir, pattern, = {}) @bucket = bucket @dir = dir.end_with?('/') ? dir : dir + "/" @pattern = pattern @options = end |
Class Method Details
.run(s3id, s3key, bucket, dir, pattern) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/s3batch/batch_upload.rb', line 40 def self.run s3id, s3key, bucket, dir, pattern EM.run { items = Upload.new bucket, dir, pattern, :aws_access_key_id => s3id, :aws_secret_access_key => s3key, :protocol => 'http', :permissions => 'public-read' items.upload } end |