<commit_before># Load classes
require "web_diff/configuration"
require "web_diff/selenium_handler"
require "web_diff/image_handler"
require "web_diff/gallery_creator"
require "web_diff/runner"

require "web_diff/version"

module WebDiff
    class << self
        def root
            File.expand_path('../..', __FILE__)
        end

        def run
            beginning_time = Time.now

            # Call "before" hook
            WebDiff.configuration.before_run

            begin
                runner = Runner.new
                runner.run
            ensure
                # Call "after" hook
                WebDiff.configuration.after_run
            end

            end_time = Time.now
            puts "Time elapsed: #{(end_time - beginning_time)} seconds"
        end

        def make_gallery(path = nil)
            # Call "before" hook
            WebDiff.configuration.before_gallery

            puts "Creating gallery..."
            begin
                if WebDiff.configuration.remote
                    gallery_creator = GalleryCreator.new(WebDiff.configuration.remote_path)
                    gallery_creator.create_gallery(WebDiff.configuration.remote_path)
                else
                    gallery_creator = GalleryCreator.new(path)
                    gallery_creator.create_gallery(path)
                end
            ensure
                # Call "after" hook
                WebDiff.configuration.after_gallery
            end
        end
    end
end

# Load tasks
Dir[WebDiff.root + '/lib/tasks/*.rake'].each { |ext| load ext } if defined?(Rake)<commit_msg>Try moving hook to see if circle embraces that<commit_after># Load classes
require "web_diff/configuration"
require "web_diff/selenium_handler"
require "web_diff/image_handler"
require "web_diff/gallery_creator"
require "web_diff/runner"

require "web_diff/version"

module WebDiff
    class << self
        def root
            File.expand_path('../..', __FILE__)
        end

        def run
            beginning_time = Time.now

            # Call "before" hook
            WebDiff.configuration.before_run

            begin
                runner = Runner.new
                runner.run
            ensure
                # Call "after" hook
                WebDiff.configuration.after_run
            end

            end_time = Time.now
            puts "Time elapsed: #{(end_time - beginning_time)} seconds"
        end

        def make_gallery(path = nil)
            puts "Creating gallery..."
            begin
                # Call "before" hook
                WebDiff.configuration.before_gallery

                if WebDiff.configuration.remote
                    gallery_creator = GalleryCreator.new(WebDiff.configuration.remote_path)
                    gallery_creator.create_gallery(WebDiff.configuration.remote_path)
                else
                    gallery_creator = GalleryCreator.new(path)
                    gallery_creator.create_gallery(path)
                end
            ensure
                # Call "after" hook
                WebDiff.configuration.after_gallery
            end
        end
    end
end

# Load tasks
Dir[WebDiff.root + '/lib/tasks/*.rake'].each { |ext| load ext } if defined?(Rake)
{'fraction_non_alphanumeric': 0.07329842931937172, 'fraction_numerical': 0.0, 'mean_word_length': 1.5921787709497206, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2919906', 'n_tokens_mistral': 864, 'n_tokens_neox': 812, 'n_words': 187}