Class: SSHKit::ConnectionManager
- Inherits:
-
Object
- Object
- SSHKit::ConnectionManager
- Defined in:
- lib/sshkit/connection_manager.rb
Instance Attribute Summary collapse
-
#hosts ⇒ Object
Returns the value of attribute hosts.
Instance Method Summary collapse
- #each(options = {}, &block) ⇒ Object
-
#initialize(raw_hosts) ⇒ ConnectionManager
constructor
A new instance of ConnectionManager.
Constructor Details
#initialize(raw_hosts) ⇒ ConnectionManager
Returns a new instance of ConnectionManager.
62 63 64 65 66 |
# File 'lib/sshkit/connection_manager.rb', line 62 def initialize(raw_hosts) @raw_hosts = Array(raw_hosts) raise NoValidHosts unless Array(raw_hosts).any? resolve_hosts! end |
Instance Attribute Details
#hosts ⇒ Object
Returns the value of attribute hosts.
60 61 62 |
# File 'lib/sshkit/connection_manager.rb', line 60 def hosts @hosts end |
Instance Method Details
#each(options = {}, &block) ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/sshkit/connection_manager.rb', line 68 def each(={}, &block) = .merge() case [:in] when :parallel then ParallelRunner when :sequence then SequentialRunner when :groups then GroupRunner else raise RuntimeError, "Don't know how to handle run style #{[:in].inspect}" end.new(hosts, &block).execute end |