Class: Slipsquare::Middleware::UploadFile

Inherits:
Base
  • Object
show all
Defined in:
lib/slipsquare/middleware/upload_file.rb

Constant Summary

Constants inherited from Base

Base::CLEAR, Base::GREEN, Base::RED, Base::YELLOW

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Slipsquare::Middleware::Base

Instance Method Details

#call(env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/slipsquare/middleware/upload_file.rb', line 4

def call(env)
  say "Uploading file..."

  contents = File.read(env['upload_file_name'])

  env['dropbox-client'].upload env['upload_file_name'], contents

  say "File '#{env['upload_file_name']}' uploaded successfully"

  @app.call(env)
end