<commit_before>module Konacha
  class Engine < Rails::Engine
    config.konacha = ActiveSupport::OrderedOptions.new

    def self.application(app)
      Rack::Builder.app do
        map app.config.assets.prefix do
          run app.assets
        end

        run Konacha::Engine
      end
    end

    initializer "konacha.environment" do |app|
      unless app.config.assets.enabled
        raise RuntimeError, "konacha requires the asset pipeline to be enabled"
      end

      options = app.config.konacha

      options.spec_dir    ||= "spec/javascripts"
      options.port        ||= 3500
      options.interface   ||= :bdd
      options.application ||= self.class.application(app)
      options.driver      ||= :selenium

      app.config.assets.paths << app.root.join(options.spec_dir).to_s
    end
  end
end<commit_msg>Add support for older versions of Rack.<commit_after>module Konacha
  class Engine < Rails::Engine
    config.konacha = ActiveSupport::OrderedOptions.new

    def self.application(app)
      Rack::Builder.app do
        map app.config.assets.prefix do
          run app.assets
        end

        map "/" do
          run Konacha::Engine
        end
      end
    end

    initializer "konacha.environment" do |app|
      unless app.config.assets.enabled
        raise RuntimeError, "konacha requires the asset pipeline to be enabled"
      end

      options = app.config.konacha

      options.spec_dir    ||= "spec/javascripts"
      options.port        ||= 3500
      options.interface   ||= :bdd
      options.application ||= self.class.application(app)
      options.driver      ||= :selenium

      app.config.assets.paths << app.root.join(options.spec_dir).to_s
    end
  end
end
{'fraction_non_alphanumeric': 0.09202096680256261, 'fraction_numerical': 0.004659289458357601, 'mean_word_length': 2.2723809523809524, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1837644', 'n_tokens_mistral': 521, 'n_tokens_neox': 486, 'n_words': 118}