Class: Duse::CLI::ApiCommand
- Defined in:
- lib/duse/cli/api_command.rb
Direct Known Subclasses
AccountConfirm, AccountInfo, AccountPasswordChange, AccountPasswordReset, AccountResendConfirmation, AccountUpdate, FolderAdd, FolderList, FolderRemove, FolderUpdate, Login, Register, SecretAdd, SecretGet, SecretList, SecretRemove, SecretTree, SecretUpdate
Instance Attribute Summary
Attributes inherited from Command
#arguments, #force_interactive, #input, #output
Instance Method Summary collapse
Methods inherited from Command
abstract, abstract?, #check_arity, #color, #command_name, command_name, #config, description, #error, #format, full_command, #full_command, has_subcommands?, has_super_command?, #help, #help_subcommands, #initialize, #interactive?, #parse, #say, skip, subcommand, subcommands, #success, super_command, super_command=, #terminal, #usage, #usage_for, #warn, #write_to, #wrong_args
Methods included from Parser
Constructor Details
This class inherits a constructor from Duse::CLI::Command
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/duse/cli/api_command.rb', line 8 def execute super rescue Duse::Client::NotLoggedIn error "not logged in, run `#$0 login`" rescue Duse::Client::Error => e error e. rescue Faraday::ConnectionFailed error 'Cannot connect to specified duse instance' rescue Interrupt say "\naborted!" end |
#setup ⇒ Object
20 21 22 23 |
# File 'lib/duse/cli/api_command.rb', line 20 def setup ensure_uri_is_set authenticate end |