Sha256: 09d331173723fd55fcf93e84fc8ab047db6660bd2ccc8d7429fb9a64d24c1ad4
Contents?: true
Size: 453 Bytes
Versions: 13
Compression:
Stored size: 453 Bytes
Contents
require "timeout" class WaitForSolr < Struct.new(:port, :timeout) def self.on port, timeout, &block new(port, timeout).wait &block end def self.running_on? port new(port).responding? end def wait &block Timeout::timeout timeout do until responding? do block.call sleep 1 end end end def responding? system %(curl -o /dev/null "http://localhost:#{port}/solr" > /dev/null 2>&1) end end
Version data entries
13 entries across 13 versions & 2 rubygems