<commit_before>require "rulers/version"
require "rulers/routing"
require "rulers/array"


module Rulers
  class Application
    def call(env)
      if env["PATH_INFO"] == '/favicon.ico'
        return [404,
                {'Content-Type' => 'text/html'}, []]
      end

      klass, act = get_controller_and_action(env)
      controller = klass.new(env)
      begin
        text = controller.send(act)
        [200, {'Content-Type' => 'text/html'},
         [text]]
      rescue 
        [500, {'Content-Type' => 'text/html'},
         ["Oh crap, something broke! Look at the stack trace."]]
      end
    end
  end

  class Controller
    attr_reader :env

    def initialize(env)
      @env = env
    end

  end
end<commit_msg>Basic hack for root until real routing is in place<commit_after>require "rulers/version"
require "rulers/routing"
require "rulers/array"


module Rulers
  class Application
    def call(env)
      if env["PATH_INFO"] == '/favicon.ico' || env["PATH_INFO"] == '/'
        return [404,
                {'Content-Type' => 'text/html'}, []]
      end

      klass, act = get_controller_and_action(env)
      controller = klass.new(env)
      begin
        text = controller.send(act)
        [200, {'Content-Type' => 'text/html'},
         [text]]
      rescue RuntimeError => e
        [500, {'Content-Type' => 'text/html'},
         ["Oh crap, something broke! Look at the stack trace.\n #{e}"]]
      end
    end
  end

  class Controller
    attr_reader :env

    def initialize(env)
      @env = env
    end

  end
end
{'fraction_non_alphanumeric': 0.13242894056847546, 'fraction_numerical': 0.011627906976744186, 'mean_word_length': 2.233820459290188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '3655356', 'n_tokens_mistral': 511, 'n_tokens_neox': 489, 'n_words': 130}