<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Hadouken.DI;
using Hadouken.Reflection;
using System.Reflection;

namespace Hadouken
{
    public static class Kernel
    {
        private static IDependencyResolver _resolver;

        public static void Bootstrap(string workingDirectory)
        {
            if(String.IsNullOrEmpty(workingDirectory))
                throw new ArgumentNullException("workingDirectory");

            foreach (var file in Directory.GetFiles(workingDirectory, "*.dll"))
            {
                try
                {
                    Assembly.LoadFile(file);
                }
                catch
                {
                }
            }
        }

        public static void SetResolver(IDependencyResolver resolver)
        {
            if(resolver == null)
                throw new ArgumentNullException("resolver");

            _resolver = resolver;
        }

        public static IDependencyResolver Resolver
        {
            get
            {
                if(_resolver == null)
                    throw new ArgumentNullException();<commit_msg>Small fix in the Bootstrap function which checks that we haven't loaded the assembly.<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Hadouken.DI;
using Hadouken.Reflection;
using System.Reflection;

namespace Hadouken
{
    public static class Kernel
    {
        private static IDependencyResolver _resolver;

        public static void Bootstrap(string workingDirectory)
        {
            if(String.IsNullOrEmpty(workingDirectory))
                throw new ArgumentNullException("workingDirectory");

            foreach (var file in Directory.GetFiles(workingDirectory, "*.dll"))
            {
                try
                {
                    var asmName = AssemblyName.GetAssemblyName(file);
                    var a = (from asm in AppDomain.CurrentDomain.GetAssemblies()
                             where asm.GetName().FullName == asmName.FullName
                             select asm).FirstOrDefault();

                    if (a == null)
                        Assembly.LoadFile(file);
                }
                catch
                {
                }
            }
        }

        public static void SetResolver(IDependencyResolver resolver)
        {
            if(resolver == null)
                throw new ArgumentNullException("resolver");

            _resolver = resolver;
        }

        public static IDependencyResolver Resolver
        {
            get
            {
                if(_resolver == null)
                    throw new ArgumentNullException();
{'fraction_non_alphanumeric': 0.06855707106963388, 'fraction_numerical': 0.0, 'mean_word_length': 1.5662983425414365, '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': '5689575', 'n_tokens_mistral': 678, 'n_tokens_neox': 631, 'n_words': 161}