Sha256: 1e66fbc56eeab2d011a374976373ab3d4621ff0d9aa715b5fddfd2f07498fc53

Contents?: true

Size: 218 Bytes

Versions: 6

Compression:

Stored size: 218 Bytes

Contents

require 'socket'

module Capybara::Poltergeist
  module Util
    def self.find_available_port
      server = TCPServer.new('127.0.0.1', 0)
      server.addr[1]
    ensure
      server.close if server
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
poltergeist-1.0.3 lib/capybara/poltergeist/util.rb
poltergeist-1.0.2 lib/capybara/poltergeist/util.rb
poltergeist-1.0.1 lib/capybara/poltergeist/util.rb
poltergeist-0.7.0 lib/capybara/poltergeist/util.rb
poltergeist-0.6.0 lib/capybara/poltergeist/util.rb
poltergeist-0.5.0 lib/capybara/poltergeist/util.rb