Class: Uberssh::App
- Inherits:
-
Object
- Object
- Uberssh::App
- Defined in:
- lib/uberssh/app.rb
Instance Method Summary collapse
-
#initialize(account_name: nil) ⇒ App
constructor
A new instance of App.
- #start ⇒ Object
Constructor Details
#initialize(account_name: nil) ⇒ App
Returns a new instance of App.
5 6 7 8 |
# File 'lib/uberssh/app.rb', line 5 def initialize(account_name: nil) @account_name = account_name @manager = AccountManager.new end |
Instance Method Details
#start ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/uberssh/app.rb', line 10 def start begin selected_account = nil unless @account_name selected_account = select_account else selected_account = @manager.account_from_name(@account_name) raise "The given Uberspace account was not found." unless selected_account end system "clear" puts "Connecting to #{selected_account.project}..." connect_via_ssh_to(selected_account) rescue Exception => e puts e. end end |