Class: RemoteRun::Configuration::HostManager
- Inherits:
-
Object
- Object
- RemoteRun::Configuration::HostManager
- Defined in:
- lib/remote_run/configuration.rb
Instance Method Summary collapse
- #add(host) ⇒ Object
- #hosts ⇒ Object
-
#initialize(&block) ⇒ HostManager
constructor
A new instance of HostManager.
Constructor Details
#initialize(&block) ⇒ HostManager
Returns a new instance of HostManager.
66 67 68 |
# File 'lib/remote_run/configuration.rb', line 66 def initialize(&block) @hosts = [] end |
Instance Method Details
#add(host) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/remote_run/configuration.rb', line 70 def add(host) Thread.new do if host.is_up? @hosts << host end end end |
#hosts ⇒ Object
78 79 80 81 82 83 |
# File 'lib/remote_run/configuration.rb', line 78 def hosts while @hosts.empty? sleep(0.5) end @hosts end |