<commit_before>module SpreeCore
  module Generators
    class ExtensionGenerator < Rails::Generators::NamedBase
      source_root File.expand_path("../../templates", __FILE__)

      desc "Creates a new extension with the name you specify."
      check_class_collision

      def create_root_files
        empty_directory file_name
        template "LICENSE", "#{file_name}/LICENSE"
        template "Rakefile", "#{file_name}/Rakefile"
        template "README.md", "#{file_name}/README.md"
        template ".gitignore", "#{file_name}/.gitignore"
        template "extension.gemspec.tt", "#{file_name}/#{file_name.dasherize}.gemspec"
      end

      def create_app_dirs
        empty_directory extension_dir('app')
        empty_directory extension_dir('app/controllers')
        empty_directory extension_dir('app/helpers')
        empty_directory extension_dir('app/metal')
        empty_directory extension_dir('app/models')
        empty_directory extension_dir('app/views')
      end

      def create_config_files
        directory "config", "#{file_name}/config"
        #empty_directory extension_dir('config/initializers')
      end

      def create_lib_files
        directory "lib", "#{file_name}/lib"
        template 'extension/engine.rb.tt', "#{file_name}/lib/#{file_name}/engine.rb"
        template 'extension/extension.rb.tt', "#{file_name}/lib/#{file_name}.rb"
      end

      def update_gemfile
        gem file_name.dasherize, :path => file_name, :require => [file_name, "#{file_name}/engine"], :group => "extensions"
      end

      protected<commit_msg>Do not generate metals directory for new extension.<commit_after>module SpreeCore
  module Generators
    class ExtensionGenerator < Rails::Generators::NamedBase
      source_root File.expand_path("../../templates", __FILE__)

      desc "Creates a new extension with the name you specify."
      check_class_collision

      def create_root_files
        empty_directory file_name
        template "LICENSE", "#{file_name}/LICENSE"
        template "Rakefile", "#{file_name}/Rakefile"
        template "README.md", "#{file_name}/README.md"
        template ".gitignore", "#{file_name}/.gitignore"
        template "extension.gemspec.tt", "#{file_name}/#{file_name.dasherize}.gemspec"
      end

      def create_app_dirs
        empty_directory extension_dir('app')
        empty_directory extension_dir('app/controllers')
        empty_directory extension_dir('app/helpers')
        empty_directory extension_dir('app/models')
        empty_directory extension_dir('app/views')
      end

      def create_config_files
        directory "config", "#{file_name}/config"
        #empty_directory extension_dir('config/initializers')
      end

      def create_lib_files
        directory "lib", "#{file_name}/lib"
        template 'extension/engine.rb.tt', "#{file_name}/lib/#{file_name}/engine.rb"
        template 'extension/extension.rb.tt', "#{file_name}/lib/#{file_name}.rb"
      end

      def update_gemfile
        gem file_name.dasherize, :path => file_name, :require => [file_name, "#{file_name}/engine"], :group => "extensions"
      end

      protected
{'fraction_non_alphanumeric': 0.12011439466158245, 'fraction_numerical': 0.0, 'mean_word_length': 3.1861702127659575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3103449', 'n_tokens_mistral': 913, 'n_tokens_neox': 902, 'n_words': 182}