<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Gate.Startup.Loader;

namespace Gate.Startup
{
    public class AppBuilder
    {
        public IConfigurationLoader ConfigurationLoader { get; set; }
        readonly IList<Func<AppDelegate, AppDelegate>> _stack = new List<Func<AppDelegate, AppDelegate>>();

        Func<AppDelegate, IDictionary<string, AppDelegate>, AppDelegate> _mapper = UrlMapper.Create;
        IDictionary<string, AppDelegate> _maps;

        public AppBuilder()
            : this(new DefaultConfigurationLoader())
        {
        }

        public AppBuilder(string configurationString)
            : this(new DefaultConfigurationLoader(), configurationString)
        {
        }

        public AppBuilder(Action<AppBuilder> configuration)
            : this(new DefaultConfigurationLoader(), configuration)
        {
        }

        public AppBuilder(IConfigurationLoader configurationLoader)
        {
            ConfigurationLoader = configurationLoader;
        }

        public AppBuilder(IConfigurationLoader configurationLoader, string configurationString)
            : this(configurationLoader)
        {
            Configure(configurationString);
        }

        public AppBuilder(IConfigurationLoader configurationLoader, Action<AppBuilder> configuration)
            : this(configurationLoader)
        {
            Configure(configuration);
        }

        public AppBuilder SetUrlMapper(Func<AppDelegate, IDictionary<string, AppDelegate>, AppDelegate> mapper)
        {
            _mapper = mapper;
            return this;
        }

        public AppBuilder Configure(Action<AppBuilder> configuration)
        {
            configuration(this);
            return this;
        }

        public AppBuilder Configure(string configurationString)
        {
            var configuration = ConfigurationLoader.Load(configurationString);
            if (configuration == null)
                throw new ArgumentException("Configuration not loadable", "configurationString");
            return Configure(configuration);
        }

        public AppBuilderExt Ext
        {
            get {return new AppBuilderExt(this);}<commit_msg>Adding parameterless Configure overload<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Gate.Startup.Loader;

namespace Gate.Startup
{
    public class AppBuilder
    {
        public IConfigurationLoader ConfigurationLoader { get; set; }
        readonly IList<Func<AppDelegate, AppDelegate>> _stack = new List<Func<AppDelegate, AppDelegate>>();

        Func<AppDelegate, IDictionary<string, AppDelegate>, AppDelegate> _mapper = UrlMapper.Create;
        IDictionary<string, AppDelegate> _maps;

        public AppBuilder()
            : this(new DefaultConfigurationLoader())
        {
        }

        public AppBuilder(string configurationString)
            : this(new DefaultConfigurationLoader(), configurationString)
        {
        }

        public AppBuilder(Action<AppBuilder> configuration)
            : this(new DefaultConfigurationLoader(), configuration)
        {
        }

        public AppBuilder(IConfigurationLoader configurationLoader)
        {
            ConfigurationLoader = configurationLoader;
        }

        public AppBuilder(IConfigurationLoader configurationLoader, string configurationString)
            : this(configurationLoader)
        {
            Configure(configurationString);
        }

        public AppBuilder(IConfigurationLoader configurationLoader, Action<AppBuilder> configuration)
            : this(configurationLoader)
        {
            Configure(configuration);
        }

        public AppBuilder SetUrlMapper(Func<AppDelegate, IDictionary<string, AppDelegate>, AppDelegate> mapper)
        {
            _mapper = mapper;
            return this;
        }

        public AppBuilder Configure()
        {
            return Configure(default(string));
        }

        public AppBuilder Configure(Action<AppBuilder> configuration)
        {
            configuration(this);
            return this;
        }

        public AppBuilder Configure(string configurationString)
        {
            var configuration = ConfigurationLoader.Load(configurationString);
            if (configuration == null)
                throw new ArgumentException("Configuration not loadable", "configurationString");
            return Configure(configuration);
        }

        public AppBuilderExt Ext
        {
            get {return new AppBuilderExt(this);}
{'fraction_non_alphanumeric': 0.07288946910356832, 'fraction_numerical': 0.0, 'mean_word_length': 2.4357249626307924, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '6062351', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1008, 'n_words': 231}