<commit_before>require 'rails/generators/rails/app/app_generator'

module ReactiveRuby
  class TestAppGenerator < ::Rails::Generators::Base
    def self.source_paths
      paths = self.superclass.source_paths
      paths << File.expand_path('../templates', __FILE__)
      paths.flatten
    end

    def remove_existing_app
      remove_dir(test_app_path) if File.directory?(test_app_path)
    end

    def generate_test_app
      opts = options.dup
      opts[:database] = 'sqlite3' if opts[:database].blank?
      opts[:force] = true
      opts[:skip_bundle] = true

      puts "Generating Test Rails Application..."
      invoke Rails::Generators::AppGenerator,
        [ File.expand_path(test_app_path, destination_root) ], opts
    end<commit_msg>Access top level rails constant<commit_after>require 'rails/generators/rails/app/app_generator'

module ReactiveRuby
  class TestAppGenerator < ::Rails::Generators::Base
    def self.source_paths
      paths = self.superclass.source_paths
      paths << File.expand_path('../templates', __FILE__)
      paths.flatten
    end

    def remove_existing_app
      remove_dir(test_app_path) if File.directory?(test_app_path)
    end

    def generate_test_app
      opts = options.dup
      opts[:database] = 'sqlite3' if opts[:database].blank?
      opts[:force] = true
      opts[:skip_bundle] = true

      puts "Generating Test Rails Application..."
      invoke ::Rails::Generators::AppGenerator,
        [ File.expand_path(test_app_path, destination_root) ], opts
    end
{'fraction_non_alphanumeric': 0.1010498687664042, 'fraction_numerical': 0.0013123359580052493, 'mean_word_length': 3.420289855072464, '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': '2766601', 'n_tokens_mistral': 465, 'n_tokens_neox': 450, 'n_words': 93}