Class: Slipsquare::CLI
- Inherits:
-
Thor
- Object
- Thor
- Slipsquare::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/slipsquare/cli.rb
Instance Method Summary collapse
- #account ⇒ Object
- #authorize ⇒ Object
- #chunked_upload(filename) ⇒ Object
- #delete(path) ⇒ Object
- #download(filename) ⇒ Object
- #get_keys ⇒ Object
- #help(meth = nil) ⇒ Object
- #ls(path = nil) ⇒ Object
- #mkdir(path) ⇒ Object
- #upload(filename) ⇒ Object
- #verify ⇒ Object
- #version ⇒ Object
Instance Method Details
#account ⇒ Object
34 35 36 |
# File 'lib/slipsquare/cli.rb', line 34 def account Middleware.sequence_account.call({}) end |
#authorize ⇒ Object
26 27 28 |
# File 'lib/slipsquare/cli.rb', line 26 def Middleware..call({}) end |
#chunked_upload(filename) ⇒ Object
82 83 84 |
# File 'lib/slipsquare/cli.rb', line 82 def chunked_upload(filename) Middleware.sequence_chunked_upload_file.call({"chunked_upload_file_name" => filename}) end |
#delete(path) ⇒ Object
69 70 71 |
# File 'lib/slipsquare/cli.rb', line 69 def delete(path) Middleware.sequence_delete_file.call({"delete_path" => path}) end |
#download(filename) ⇒ Object
40 41 42 |
# File 'lib/slipsquare/cli.rb', line 40 def download(filename) Middleware.sequence_download_file.call({"download_file_name" => filename}) end |
#get_keys ⇒ Object
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/slipsquare/cli.rb', line 87 def get_keys say "Please open this URL from your Browser, and login: https://www2.dropbox.com/developers/apps" say "Click \"Create app\" button, and choose the following options:" say "Type: Dropbox API app" say "Data: Files and Datastores" say "Permission type: Full Dropbox" say "File Types: All file types" say "App name: Slipsquare#{Time.now.to_i}" say "Cick on the \"Create\" button, and note down the 'app key' and 'app secret'" end |
#help(meth = nil) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/slipsquare/cli.rb', line 16 def help(meth=nil) super if !meth say "To learn more or to contribute, please see github.com/petems/slipsquare" end end |
#ls(path = nil) ⇒ Object
56 57 58 |
# File 'lib/slipsquare/cli.rb', line 56 def ls(path=nil) Middleware.sequence_ls.call({"list_files_path" => path}) end |
#mkdir(path) ⇒ Object
63 64 65 |
# File 'lib/slipsquare/cli.rb', line 63 def mkdir(path) Middleware.sequence_mkdir.call({"mkdir_path" => path}) end |
#upload(filename) ⇒ Object
75 76 77 |
# File 'lib/slipsquare/cli.rb', line 75 def upload(filename) Middleware.sequence_upload_file.call({"upload_file_name" => filename}) end |
#verify ⇒ Object
46 47 48 |
# File 'lib/slipsquare/cli.rb', line 46 def verify Middleware.sequence_verify.call({}) end |
#version ⇒ Object
99 100 101 |
# File 'lib/slipsquare/cli.rb', line 99 def version say "Slipsquare #{Slipsquare::VERSION}" end |