Class: Mode::CLI::Base

Inherits:
Thor
  • Object
show all
Defined in:
lib/mode/cli/base.rb,
lib/mode/cli/login.rb,
lib/mode/cli/connect.rb

Instance Method Summary collapse

Instance Method Details

#connect(command = 'start') ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mode/cli/connect.rb', line 13

def connect(command = 'start')
  if command == 'verify'
    Mode::Commands::Connect.new(command, options).verify!
    say "Success! All config and connectivity checks passed"
  elsif ['start', 'status', 'stop', 'restart'].include?(command)
    Mode::Commands::Connect.new(command, options).execute
  else
    say "Error: valid commands for connect are start, stop and restart"
  end
rescue => err
  say "Error: #{err.message} #{err.backtrace}"
end

#loginObject



8
9
10
# File 'lib/mode/cli/login.rb', line 8

def 
  Mode::Commands::.new(options).execute
end

#versionObject



11
12
13
# File 'lib/mode/cli/base.rb', line 11

def version
  say "Mode Connector Version #{Mode::VERSION}"
end