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

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ WinRM

Returns a new instance of WinRM.



58
59
60
61
# File 'lib/train/transports/winrm.rb', line 58

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

Instance Method Details

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



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/train/transports/winrm.rb', line 64

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