<commit_before>require 'net/http'
require 'net/https'
require 'fileutils'

require 'nokogiri'
require 'open-uri'

# require 'sinatra'

class GenerateFunnelbackReport

    FUNNELBACK_REPORT_HTML = "report.html"
    USAGE_CHART_HTML = "usage-summary-chart.html"

    attr_reader :all_report_filename
    attr_reader :monthly_usage_filename
    attr_reader :usage_chart_filename
    attr_reader :output_location
    attr_reader :queries_per_hour_filename

    def initialize(output_location)

        @all_report_filename = "all_report.html"
        @monthly_usage_filename = "monthly-usage-table.html"
        @usage_chart_filename = "usage-summary-chart.png"
        @queries_per_hour_filename = "queries-per-hour.png"

        # inefficient way of adding / to both ends
        if !output_location.end_with? "/"
            output_location = output_location + "/"
        end

        if !output_location.start_with? "/"
            output_location = "/" + output_location
        end

        @output_location = "report" + output_location
        if !File.exists?(@output_location)
            FileUtils.mkdir(@output_location)
        end

        # Set up HTTP client to get report page and get past HTTP Auth
        @http = Net::HTTP.new(ENV['FUNNELBACK_URL'], 8443)
        @http = Net::HTTP.new(ENV['FUNNELBACK_URL'], 8443)
        @http.use_ssl = true
        @http.verify_mode = OpenSSL::SSL::VERIFY_NONE

    end<commit_msg>make directories recursively<commit_after>require 'net/http'
require 'net/https'
require 'fileutils'

require 'nokogiri'
require 'open-uri'

# require 'sinatra'

class GenerateFunnelbackReport

    FUNNELBACK_REPORT_HTML = "report.html"
    USAGE_CHART_HTML = "usage-summary-chart.html"

    attr_reader :all_report_filename
    attr_reader :monthly_usage_filename
    attr_reader :usage_chart_filename
    attr_reader :output_location
    attr_reader :queries_per_hour_filename

    def initialize(output_location)

        @all_report_filename = "all_report.html"
        @monthly_usage_filename = "monthly-usage-table.html"
        @usage_chart_filename = "usage-summary-chart.png"
        @queries_per_hour_filename = "queries-per-hour.png"

        # inefficient way of adding / to both ends
        if !output_location.end_with? "/"
            output_location = output_location + "/"
        end

        if !output_location.start_with? "/"
            output_location = "/" + output_location
        end

        @output_location = "report" + output_location
        if !File.exists?(@output_location)
            FileUtils.mkdir_p(@output_location)
        end

        # Set up HTTP client to get report page and get past HTTP Auth
        @http = Net::HTTP.new(ENV['FUNNELBACK_URL'], 8443)
        @http = Net::HTTP.new(ENV['FUNNELBACK_URL'], 8443)
        @http.use_ssl = true
        @http.verify_mode = OpenSSL::SSL::VERIFY_NONE

    end
{'fraction_non_alphanumeric': 0.09428076256499134, 'fraction_numerical': 0.005545927209705373, 'mean_word_length': 3.002773925104022, 'pattern_counts': {'":': 0, '<': 3, '<?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': '740554', 'n_tokens_mistral': 915, 'n_tokens_neox': 885, 'n_words': 173}