Class: TrainPlugins::WinRM::Transport
- Inherits:
-
Object
- Object
- TrainPlugins::WinRM::Transport
- Defined in:
- lib/train-winrm/transport.rb
Overview
A Transport which uses WinRM to execute commands and transfer files.
Constant Summary collapse
- SUPPORTED_WINRM_TRANSPORTS =
%i{negotiate ssl plaintext kerberos}.freeze
- SUPPORTED_WINRM_SHELL_TYPES =
%i{powershell elevated cmd}.freeze
Instance Method Summary collapse
- #connection(state = nil, &block) ⇒ Object
-
#initialize(opts) ⇒ Transport
constructor
A new instance of Transport.
Constructor Details
#initialize(opts) ⇒ Transport
Returns a new instance of Transport.
81 82 83 84 |
# File 'lib/train-winrm/transport.rb', line 81 def initialize(opts) super(opts) load_needed_dependencies! end |
Instance Method Details
#connection(state = nil, &block) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/train-winrm/transport.rb', line 87 def connection(state = nil, &block) opts = (, state || {}) (opts) conn_opts = (opts) if @connection && @connection_options == conn_opts reuse_connection(&block) else create_new_connection(conn_opts, &block) end end |