<commit_before>require 'billy'
require 'watir-webdriver'

module Billy
  module Browsers
    class Watir < ::Watir::Browser

      def initialize(name, args = {})
        @defaults = {
          chrome: {
            switches: %W[--proxy-server=#{Billy.config.proxy_host}:#{Billy.config.proxy_port}]
          },
          phantomjs: {
            args: %W[--proxy=#{Billy.config.proxy_host}:#{Billy.config.proxy_port}]
          },
          firefox: {
            profile: Selenium::WebDriver::Firefox::Profile.new,
            proxy: Selenium::WebDriver::Proxy.new(
              http: "#{Billy.config.proxy_host}:#{Billy.config.proxy_port}",
              ssl: "#{Billy.config.proxy_host}:#{Billy.config.proxy_port}"
            )
          }
        }

        args = case name
          when :chrome then configure_chrome(args)
          when :phantomjs then configure_phantomjs(args)
          else configure_firefox(args)<commit_msg>Fixed Watir initialization<commit_after>require 'billy'
require 'watir-webdriver'

module Billy
  module Browsers
    class Watir < ::Watir::Browser

      def initialize(name, args = {})
        @defaults = {
          chrome: {
            switches: %W[--proxy-server=#{Billy.proxy.host}:#{Billy.proxy.port}]
          },
          phantomjs: {
            args: %W[--proxy=#{Billy.proxy.host}:#{Billy.proxy.port}]
          },
          firefox: {
            profile: Selenium::WebDriver::Firefox::Profile.new,
            proxy: Selenium::WebDriver::Proxy.new(
              http: "#{Billy.proxy.host}:#{Billy.proxy.port}",
              ssl: "#{Billy.proxy.host}:#{Billy.proxy.port}"
            )
          }
        }

        args = case name
          when :chrome then configure_chrome(args)
          when :phantomjs then configure_phantomjs(args)
          else configure_firefox(args)
{'fraction_non_alphanumeric': 0.1370309951060359, 'fraction_numerical': 0.0, 'mean_word_length': 2.0820770519262983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '745558', 'n_tokens_mistral': 566, 'n_tokens_neox': 550, 'n_words': 87}