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 =
%i(negotiate ssl plaintext kerberos).freeze

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ WinRM

Returns a new instance of WinRM.



72
73
74
75
# File 'lib/train/transports/winrm.rb', line 72

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

Instance Method Details

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



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/train/transports/winrm.rb', line 78

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