<commit_before>require 'rails/generators'

module Spree
  module Generators
    class TestAppGenerator < Rails::Generators::Base

      class_option :app_name, :type => :string,
                              :desc => "The name of the test rails app to generate. Defaults to test_app.",
                              :default => "test_app"

      def self.source_root
        File.expand_path('../../templates', __FILE__)
      end

      def generate_app
        remove_directory_if_exists("spec/#{test_app}")
        inside "spec" do
          run "rails new #{test_app} -GJTq --skip-gemfile"
        end
      end

      def create_rspec_gemfile
        # newer versions of rspec require a Gemfil in the local gem dirs so create one there as well as in spec/test_app
        template "Gemfile"
      end

      def create_root
        self.destination_root = File.expand_path("spec/#{test_app}", destination_root)
      end<commit_msg>Force overwrite of Gemfile during rake_testapp<commit_after>require 'rails/generators'

module Spree
  module Generators
    class TestAppGenerator < Rails::Generators::Base

      class_option :app_name, :type => :string,
                              :desc => "The name of the test rails app to generate. Defaults to test_app.",
                              :default => "test_app"

      def self.source_root
        File.expand_path('../../templates', __FILE__)
      end

      def generate_app
        remove_directory_if_exists("spec/#{test_app}")
        inside "spec" do
          run "rails new #{test_app} -GJTq --skip-gemfile"
        end
      end

      def create_rspec_gemfile
        # newer versions of rspec require a Gemfil in the local gem dirs so create one there as well as in spec/test_app
        template "Gemfile", :force => true
      end

      def create_root
        self.destination_root = File.expand_path("spec/#{test_app}", destination_root)
      end
{'fraction_non_alphanumeric': 0.0842433697347894, 'fraction_numerical': 0.0, 'mean_word_length': 2.201331114808652, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5313748', 'n_tokens_mistral': 550, 'n_tokens_neox': 532, 'n_words': 164}