Class: VPS::CLI::Playbook::State::SSHMock

Inherits:
Object
  • Object
show all
Defined in:
lib/vps/cli/playbook/state.rb

Instance Method Summary collapse

Constructor Details

#initializeSSHMock

Returns a new instance of SSHMock.



8
9
10
# File 'lib/vps/cli/playbook/state.rb', line 8

def initialize
  puts "🏄‍♀️ ~> ".gray + "Mocking SSH connection with Ubuntu 18.04.2 LTS server".cyan
end

Instance Method Details

#exec!(command) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vps/cli/playbook/state.rb', line 11

def exec!(command)
  case command
  when "cat /etc/lsb-release"
    <<-LSB
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=18.04
    DISTRIB_CODENAME=bionic
    DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
    LSB
  when "pwd"
    "/home/myapp"
  else
    raise "Encountered unexpected command: #{command}"
  end
end