<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

    def configure_test_app
      template 'boot.rb.erb', "#{test_app_path}/config/boot.rb", force: true
      template 'test_application.rb.erb', "#{test_app_path}/config/application.rb", force: true
      template 'assets/javascripts/test_application.rb',
        "#{test_app_path}/app/assets/javascripts/application.rb", force: true
      template 'assets/javascripts/server_rendering.js',
               "#{test_app_path}/app/assets/javascripts/server_rendering.rb", force: true
      template 'assets/javascripts/components.rb',
        "#{test_app_path}/app/views/components.rb", force: true
      template 'views/components/hello_world.rb',
        "#{test_app_path}/app/views/components/hello_world.rb", force: true
      template 'views/components/todo.rb',
        "#{test_app_path}/app/views/components/todo.rb", force: true
      template 'views/layouts/test_layout.html.erb',
        "#{test_app_path}/app/views/layouts/test_layout.html.erb", force: true
      template 'views/layouts/test_layout.html.erb',
        "#{test_app_path}/app/views/layouts/explicit_layout.html.erb", force: true
    end<commit_msg>use correct file name<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

    def configure_test_app
      template 'boot.rb.erb', "#{test_app_path}/config/boot.rb", force: true
      template 'test_application.rb.erb', "#{test_app_path}/config/application.rb", force: true
      template 'assets/javascripts/test_application.rb',
        "#{test_app_path}/app/assets/javascripts/application.rb", force: true
      template 'assets/javascripts/server_rendering.js',
               "#{test_app_path}/app/assets/javascripts/server_rendering.js", force: true
      template 'assets/javascripts/components.rb',
        "#{test_app_path}/app/views/components.rb", force: true
      template 'views/components/hello_world.rb',
        "#{test_app_path}/app/views/components/hello_world.rb", force: true
      template 'views/components/todo.rb',
        "#{test_app_path}/app/views/components/todo.rb", force: true
      template 'views/layouts/test_layout.html.erb',
        "#{test_app_path}/app/views/layouts/test_layout.html.erb", force: true
      template 'views/layouts/test_layout.html.erb',
        "#{test_app_path}/app/views/layouts/explicit_layout.html.erb", force: true
    end
{'fraction_non_alphanumeric': 0.1267379679144385, 'fraction_numerical': 0.0005347593582887701, 'mean_word_length': 3.5072289156626506, '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': '3106710', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1177, 'n_words': 188}