<commit_before>require 'thin'

DEFAULT_SERVER_OPTIONS = {
    'uploads_dir' => './uploads',
    'uploads_url' => 'http://localhost:3000/uploads/',
    'db_path' => './perus.db',
    'listen' => '0.0.0.0',
    'port' => 3000,
    'site_name' => 'Perus',
    'url_prefix' => '/'
}

module Perus::Server
    class Server
        def initialize(options_path = DEFAULT_SERVER_OPTIONS_PATH)
            self.class.options.load(options_path, DEFAULT_SERVER_OPTIONS)
            DB.start
        end

        def run
            Thin::Server.start(
                self.class.options.listen,
                self.class.options.port.to_i,
                App
            )<commit_msg>Update server defaults for iniparse<commit_after>require 'thin'

DEFAULT_SERVER_OPTIONS = {
    '__anonymous__' => {
        'uploads_dir' => './uploads',
        'uploads_url' => 'http://localhost:3000/uploads/',
        'db_path' => './perus.db',
        'listen' => '0.0.0.0',
        'port' => 3000,
        'site_name' => 'Perus',
        'url_prefix' => '/'
    }
}

module Perus::Server
    class Server
        def initialize(options_path = DEFAULT_SERVER_OPTIONS_PATH)
            self.class.options.load(options_path, DEFAULT_SERVER_OPTIONS)
            DB.start
        end

        def run
            Thin::Server.start(
                self.class.options.listen,
                self.class.options.port.to_i,
                App
            )
{'fraction_non_alphanumeric': 0.13696715583508037, 'fraction_numerical': 0.016771488469601678, 'mean_word_length': 1.892929292929293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5294018', 'n_tokens_mistral': 478, 'n_tokens_neox': 444, 'n_words': 71}