Class: RemoteRun::Configuration::HostManager

Inherits:
Object
  • Object
show all
Defined in:
lib/remote_run/configuration.rb

Instance Method Summary collapse

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

#hostsObject



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