<commit_before>class Capybara::Driver::Webkit
  class RemoteBrowser < Capybara::Driver::Webkit::Browser
    attr :remote_host, :remote_port
    
    def self.open_sockets; @@_sockets ||= [ ]; end
    
    at_exit do
      socks = Capybara::Driver::Webkit::RemoteBrowser.open_sockets()
      while(socks.length > 0)
        s = socks.shift()
        s.close() rescue nil
      end
    end
    
    def initialize(hostname, port, options = { })
      @remote_host = hostname
      @remote_port = port
      super(options)
      Capybara::Driver::Webkit::RemoteBrowser.open_sockets << @socket
    end
    
    def disconnect!
      @socket.close rescue nil
      Capybara::Driver::Webkit::RemoteBrowser.open_sockets.delete(@socket)
      true
    end
    
    def start_server ; end
    
    def attempt_connect
      @socket = @socket_class.open(remote_host, remote_port)
      rescue Errno::ECONNREFUSED
    end
  end 
end<commit_msg>Rewrote capybara-webkit-remote to work with capybara 0.12.0<commit_after>class Capybara::Driver::Webkit
  class RemoteConnection < Capybara::Driver::Webkit::Connection
    def self.open_sockets; @@_sockets ||= [ ]; end
    at_exit do
      socks = Capybara::Driver::Webkit::RemoteConnection.open_sockets()
      while(socks.length > 0)
        s = socks.shift()
        s.close() rescue nil
      end
    end
    def initialize(remote_host, remote_port, options)
      @remote_host = remote_host
      @remote_port = remote_port
      super(options)
      Capybara::Driver::Webkit::RemoteConnection.open_sockets << @socket
    end
    def close
      @socket.close rescue nil
      Capybara::Driver::Webkit::RemoteConnection.open_sockets.delete(@socket)
      true
    end
    def start_server ; end
    def attempt_connect
      @socket = @socket_class.open(@remote_host, @remote_port)
      rescue Errno::ECONNREFUSED
    end
  end
  
  class RemoteBrowser < Capybara::Driver::Webkit::Browser
    attr :remote_host, :remote_port
    
    def initialize(hostname, port, options = { })
      @connection = Capybara::Driver::Webkit::RemoteConnection.new(hostname, port, options)
      super(@connection)
    end
    
    def disconnect!
      @connection.close rescue nil
      true
    end
  end 
end
{'fraction_non_alphanumeric': 0.10076130765785939, 'fraction_numerical': 0.0026869682042095834, 'mean_word_length': 2.982174688057041, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '243107', 'n_tokens_mistral': 698, 'n_tokens_neox': 694, 'n_words': 142}