Class: EacRubyUtils::Envs::SshEnv

Inherits:
BaseEnv
  • Object
show all
Defined in:
lib/eac_ruby_utils/envs/ssh_env.rb

Instance Method Summary collapse

Methods inherited from BaseEnv

#command, #file_exist?

Constructor Details

#initialize(user_hostname) ⇒ SshEnv

Returns a new instance of SshEnv.



4
5
6
# File 'lib/eac_ruby_utils/envs/ssh_env.rb', line 4

def initialize(user_hostname)
  @user_hostname = user_hostname
end

Instance Method Details

#command_line(line) ⇒ Object



12
13
14
# File 'lib/eac_ruby_utils/envs/ssh_env.rb', line 12

def command_line(line)
  "ssh #{Shellwords.escape(@user_hostname)} #{Shellwords.escape(line)}"
end

#to_sObject



8
9
10
# File 'lib/eac_ruby_utils/envs/ssh_env.rb', line 8

def to_s
  "SSH(#{@user_hostname})"
end