Method: Condensr#condense
- Defined in:
- lib/condensr.rb
#condense(options) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/condensr.rb', line 43 def condense() # options should be # { # upload_type: 'aws' || 'gcloud', # file_url: file_url, # destination_name: destination_name # acl: optional, 'public-read' as default in the list of aws canned acl (http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) # } fail ArgumentError.new("Required options not supplied") if (![:upload_type] || ![:file_url]) [:file_name] = Condensr.extract_file_name([:file_url]) [:destination_name] = [:destination_name].empty? ? [:file_name] : [:destination_name] file_path = download() output = upload(, file_path) clear_file(file_path) output end |