Class: Dip::CLI::SSH

Inherits:
Thor
  • Object
show all
Defined in:
lib/dip/cli/ssh.rb

Instance Method Summary collapse

Instance Method Details

#downObject



38
39
40
41
42
43
44
# File 'lib/dip/cli/ssh.rb', line 38

def down
  if options[:help]
    invoke :help, ['down']
  else
    Dip::Commands::SSH::Down.new.execute
  end
end

#restart(*args) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/dip/cli/ssh.rb', line 49

def restart(*args)
  if options[:help]
    invoke :help, ['restart']
  else
    Dip::CLI::SSH.start(["down"] + args)
    sleep 1
    Dip::CLI::SSH.start(["up"] + args)
  end
end

#statusObject



62
63
64
65
66
67
68
# File 'lib/dip/cli/ssh.rb', line 62

def status
  if options[:help]
    invoke :help, ['status']
  else
    Dip::Commands::SSH::Status.new.execute
  end
end

#upObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dip/cli/ssh.rb', line 21

def up
  if options[:help]
    invoke :help, ['up']
  else
    Dip::Commands::SSH::Up.new(
      key: options.fetch(:key),
      volume: options.fetch(:volume),
      interactive: options.nonteractive? ? false : options.interactive?
    ).execute
  end
end