<commit_before>require "selenium/webdriver"

module SauceDriver
  class << self

    def username
      ENV['SAUCE_USERNAME']
    end

    def access_key
      ENV['SAUCE_ACCESS_KEY']
    end

    def authentication
      "#{username}:#{access_key}"
    end

    def sauce_server
      'ondemand.saucelabs.com'
    end

    def sauce_port
      80
    end

    def endpoint
      "http://#{authentication}@#{sauce_server}:#{sauce_port}/wd/hub"
    end

    def environment_capabilities
      browser = ENV['SAUCE_BROWSER']
      version = ENV['SAUCE_VERSION']
      platform = "Mac OS X 10.10"

      if browser && version && platform
        return {
          :browserName => browser,
          :version => version,
          :platform => platform
        }
      end

      return nil
    end

    def desired_caps
      environment_capabilities
    end

    def webdriver_config
      {
        :browser => :remote,
        :url => endpoint,
        :desired_capabilities => desired_caps
      }
    end
  end
end<commit_msg>add tunnel identifier<commit_after>require "selenium/webdriver"

module SauceDriver
  class << self

    def username
      ENV['SAUCE_USERNAME']
    end

    def access_key
      ENV['SAUCE_ACCESS_KEY']
    end

    def authentication
      "#{username}:#{access_key}"
    end

    def sauce_server
      'ondemand.saucelabs.com'
    end

    def sauce_port
      80
    end

    def endpoint
      "http://#{authentication}@#{sauce_server}:#{sauce_port}/wd/hub"
    end

    def environment_capabilities
      browser = ENV['SAUCE_BROWSER']
      version = ENV['SAUCE_VERSION']
      platform = "Mac OS X 10.10"
      tunnel_identifier = ENV['TRAVIS_JOB_NUMBER']

      if browser && version && platform
        return {
          :browserName => browser,
          :version => version,
          :platform => platform,
          :tunnel_identifier => tunnel_identifier
        }
      end

      return nil
    end

    def desired_caps
      environment_capabilities
    end

    def webdriver_config
      {
        :browser => :remote,
        :url => endpoint,
        :desired_capabilities => desired_caps
      }
    end
  end
end
{'fraction_non_alphanumeric': 0.08902214022140222, 'fraction_numerical': 0.005535055350553505, 'mean_word_length': 2.0592383638928067, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, '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': '7517353', 'n_tokens_mistral': 691, 'n_tokens_neox': 661, 'n_words': 147}