Class: RemoteRuby::SSHStdinAdapter
- Inherits:
-
StdinProcessAdapter
- Object
- ConnectionAdapter
- StdinProcessAdapter
- RemoteRuby::SSHStdinAdapter
- Defined in:
- lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb
Overview
An adapter to execute Ruby code on the remote server via SSH
Instance Attribute Summary collapse
-
#key_file ⇒ Object
readonly
Returns the value of attribute key_file.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#working_dir ⇒ Object
readonly
Returns the value of attribute working_dir.
Instance Method Summary collapse
- #connection_name ⇒ Object
-
#initialize(server:, working_dir: '~', user: nil, key_file: nil) ⇒ SSHStdinAdapter
constructor
A new instance of SSHStdinAdapter.
Methods inherited from StdinProcessAdapter
Methods inherited from ConnectionAdapter
Constructor Details
#initialize(server:, working_dir: '~', user: nil, key_file: nil) ⇒ SSHStdinAdapter
Returns a new instance of SSHStdinAdapter.
8 9 10 11 12 13 14 |
# File 'lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb', line 8 def initialize(server:, working_dir: '~', user: nil, key_file: nil) super @working_dir = working_dir @server = user.nil? ? server : "#{user}@#{server}" @user = user @key_file = key_file end |
Instance Attribute Details
#key_file ⇒ Object (readonly)
Returns the value of attribute key_file.
6 7 8 |
# File 'lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb', line 6 def key_file @key_file end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
6 7 8 |
# File 'lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb', line 6 def server @server end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb', line 6 def user @user end |
#working_dir ⇒ Object (readonly)
Returns the value of attribute working_dir.
6 7 8 |
# File 'lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb', line 6 def working_dir @working_dir end |
Instance Method Details
#connection_name ⇒ Object
16 17 18 |
# File 'lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb', line 16 def connection_name "#{server}:#{working_dir}" end |