<commit_before>require 'rails/generators/base'

module InstantWebsite
  module Generators
    class ThemeGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)
      argument    :theme_name, type: :string
      desc        "Generates a new blank theme"

     def create_theme_directory
        empty_directory theme_views_layout
        empty_directory theme_images_directory
        empty_directory theme_javascripts_directory
        empty_directory theme_stylesheets_directory
        empty_directory theme_locales_directory
        create_file     "#{theme_images_directory}/.gitkeep", nil
        create_file     "#{theme_locales_directory}/.gitkeep", nil
      end

      def copy_manifest_files
        copy_file       "all.js.coffee",  "#{theme_javascripts_directory}/all.js.coffee"
        copy_file       "all.scss",       "#{theme_stylesheets_directory}/all.scss"
      end

      def copy_layout_file
        template "layout.liquid", "#{theme_views_layout}/#{theme_name}.liquid"
      end

      private

        def theme_directory
          "app/themes/#{theme_name}"
        end

        def theme_views_layout
          "#{theme_directory}/views/layouts"
        end

        def theme_images_directory
          "#{theme_directory}/assets/images/#{theme_name}"<commit_msg>allow generate theme in another directory<commit_after>require 'rails/generators/base'

module InstantWebsite
  module Generators
    class ThemeGenerator < ::Rails::Generators::Base
      source_root   File.expand_path("../templates", __FILE__)
      argument      :theme_name, type: :string
      class_option  :theme_directory, type: :string, default: 'app/themes', desc: 'Theme Directory'
      desc          "Generates a new blank theme"

     def create_theme_directory
        empty_directory theme_views_layout
        empty_directory theme_images_directory
        empty_directory theme_javascripts_directory
        empty_directory theme_stylesheets_directory
        empty_directory theme_locales_directory
        create_file     "#{theme_images_directory}/.gitkeep", nil
        create_file     "#{theme_locales_directory}/.gitkeep", nil
      end

      def copy_manifest_files
        copy_file       "all.js.coffee",  "#{theme_javascripts_directory}/all.js.coffee"
        copy_file       "all.scss",       "#{theme_stylesheets_directory}/all.scss"
      end

      def copy_layout_file
        template "layout.liquid", "#{theme_views_layout}/#{theme_name}.liquid"
      end

      private

        def theme_directory
          "#{options.theme_directory}/#{theme_name}"
        end

        def theme_views_layout
          "#{theme_directory}/views/layouts"
        end

        def theme_images_directory
          "#{theme_directory}/assets/images/#{theme_name}"
{'fraction_non_alphanumeric': 0.0823278921220724, 'fraction_numerical': 0.0, 'mean_word_length': 2.804318488529015, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6980386', 'n_tokens_mistral': 804, 'n_tokens_neox': 778, 'n_words': 149}