Class: Train::Transports::WinRM

Inherits:
Object
  • Object
show all
Defined in:
lib/train/transports/winrm.rb,
lib/train/transports/winrm_connection.rb

Overview

Author

Salim Afiune (<[email protected]>)

Author

Matt Wrock (<[email protected]>)

Author

Fletcher Nichol (<[email protected]>)

Author

Dominik Richter (<[email protected]>)

Author

Christoph Hartmann (<[email protected]>)

Copyright © 2014, Salim Afiune

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defined Under Namespace

Classes: Connection

Constant Summary collapse

SUPPORTED_WINRM_TRANSPORTS =

ref: github.com/WinRb/Winrm#transports kerberos is skipped here as the options are not exposed in train basic ssl options is only supported

%i(negotiate ssl plaintext).freeze

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ WinRM

Returns a new instance of WinRM.



66
67
68
69
# File 'lib/train/transports/winrm.rb', line 66

def initialize(opts)
  super(opts)
  load_needed_dependencies!
end

Instance Method Details

#connection(state = nil, &block) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
# File 'lib/train/transports/winrm.rb', line 72

def connection(state = nil, &block)
  opts = merge_options(options, state || {})
  validate_options(opts)
  conn_opts = connection_options(opts)

  if @connection && @connection_options == conn_opts
    reuse_connection(&block)
  else
    create_new_connection(conn_opts, &block)
  end
end