<commit_before>module Jasmine
  class Config
    require 'yaml'
    require 'erb'

    def browser
      ENV["JASMINE_BROWSER"] || 'firefox'
    end

    def jasmine_host
      ENV["JASMINE_HOST"] || 'http://localhost'
    end

    def jasmine_port
      ENV["JASMINE_PORT"] || Jasmine::find_unused_port
    end

    def start_server(port = 8888)
      server = Rack::Server.new(:Port => port, :AccessLog => [])
      server.instance_variable_set(:@app, Jasmine.app(self)) # workaround for Rack bug, when Rack > 1.2.1 is released Rack::Server.start(:app => Jasmine.app(self)) will work
      server.start
    end

    def start
      start_jasmine_server
      @client = Jasmine::SeleniumDriver.new(browser, "#{jasmine_host}:#{@jasmine_server_port}/")
      @client.connect
    end

    def stop
      @client.disconnect
    end

    def start_jasmine_server
      @jasmine_server_port = jasmine_port
      Thread.new do
        start_server(@jasmine_server_port)
      end
      Jasmine::wait_for_listener(@jasmine_server_port, "jasmine server")
      puts "jasmine server started."
    end

    def windows?
      require 'rbconfig'
      ::RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
    end<commit_msg>fixing the json require for selenium<commit_after>module Jasmine
  class Config
    require 'yaml'
    require 'erb'

    def browser
      ENV["JASMINE_BROWSER"] || 'firefox'
    end

    def jasmine_host
      ENV["JASMINE_HOST"] || 'http://localhost'
    end

    def jasmine_port
      ENV["JASMINE_PORT"] || Jasmine::find_unused_port
    end

    def start_server(port = 8888)
      server = Rack::Server.new(:Port => port, :AccessLog => [])
      server.instance_variable_set(:@app, Jasmine.app(self)) # workaround for Rack bug, when Rack > 1.2.1 is released Rack::Server.start(:app => Jasmine.app(self)) will work
      server.start
    end

    def start
      start_jasmine_server
      @client = Jasmine::SeleniumDriver.new(browser, "#{jasmine_host}:#{@jasmine_server_port}/")
      @client.connect
    end

    def stop
      @client.disconnect
    end

    def start_jasmine_server
      require 'json'
      @jasmine_server_port = jasmine_port
      Thread.new do
        start_server(@jasmine_server_port)
      end
      Jasmine::wait_for_listener(@jasmine_server_port, "jasmine server")
      puts "jasmine server started."
    end

    def windows?
      require 'rbconfig'
      ::RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
    end
{'fraction_non_alphanumeric': 0.10984540276647681, 'fraction_numerical': 0.005695687550854353, 'mean_word_length': 2.940705128205128, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5591819', 'n_tokens_mistral': 871, 'n_tokens_neox': 796, 'n_words': 170}