<commit_before>require 'ioc'
require 'default_command'
require 'index_command'

module Booty
  class BootstrapRouting
    def initialize(registry = Booty::IOC.resolve(:command_registry), container = Booty::IOC.resolve(:container))
      @registry = registry
      @container = container
    end

    def run
      @registry.register_route(Booty::Dashboard::IndexCommand.new(@container.resolve(:view_engine))) do |request|
        request["REQUEST_PATH"] == "/"
      end
      @registry.register_route(DefaultCommand.new(@container.resolve(:view_engine))) { |request| true }
    end
  end
end<commit_msg>register the asset command in the route registration<commit_after>require 'ioc'
require 'default_command'
require 'index_command'
require "asset_command"

module Booty
  class BootstrapRouting
    def initialize(registry = Booty::IOC.resolve(:command_registry), container = Booty::IOC.resolve(:container))
      @registry = registry
      @container = container
    end

    def run
      register(Booty::Assets::AssetCommand.new)
      register(Booty::Dashboard::IndexCommand.new(@container.resolve(:view_engine)))
      register(DefaultCommand.new(@container.resolve(:view_engine))) { |request| true }
    end

    private

    def register(command)
      if( block_given? )
        @registry.register_route(command) { |request| yield(request) }
      else
        @registry.register_route(command) { |request| command.matches(request) }
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11284840244731476, 'fraction_numerical': 0.0, 'mean_word_length': 4.201413427561837, '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': '6586721', 'n_tokens_mistral': 415, 'n_tokens_neox': 413, 'n_words': 85}