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

module Hightail
  class Generator < Rails::Generators::AppGenerator
    class_option :database,
      type: :string,
      aliases: '-d',
      default: 'postgresql',
      desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})"

    class_option :skip_bundle,
      :type => :boolean,
      :default => true,
      :desc => "Don't run bundle install"

    class_option :skip_test_unit,
      type: :boolean,
      aliases: '-T',
      default: true,
      desc: 'Skip Test::Unit files'

    class_option :skip_rspec,
      type: :boolean,
      aliases: '-R',
      default: false,
      desc: 'Skip RSpec files'

    class_option :skip_rvm,
      type: :boolean,
      aliases: '-V',
      default: false,
      desc: 'Skip RVM files'

    def initialize(*args)
      raise Rails::Generators::Error, 'Options should be given after the application name. For details run: hightail --help' if args[0].blank?
      super
    end

    def finish_template
      invoke :hightail_customization
      super
    end

    def hightail_customization
      build :rvm unless options[:skip_rvm]
      build :rspec unless options[:skip_rspec]
      build :generators
      build :stylesheets
      build :lib_app_name
      build :remove_public_index
      build :remove_rails_logo
    end

    protected

    def self.banner<commit_msg>Remove aliases for new options.<commit_after>require 'rails/generators'
require 'rails/generators/rails/app/app_generator'

module Hightail
  class Generator < Rails::Generators::AppGenerator
    class_option :database,
      type: :string,
      aliases: '-d',
      default: 'postgresql',
      desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})"

    class_option :skip_bundle,
      :type => :boolean,
      :default => true,
      :desc => "Don't run bundle install"

    class_option :skip_test_unit,
      type: :boolean,
      aliases: '-T',
      default: true,
      desc: 'Skip Test::Unit files'

    class_option :skip_rspec,
      type: :boolean,
      default: false,
      desc: 'Skip RSpec files'

    class_option :skip_rvm,
      type: :boolean,
      default: false,
      desc: 'Skip RVM files'

    def initialize(*args)
      raise Rails::Generators::Error, 'Options should be given after the application name. For details run: hightail --help' if args[0].blank?
      super
    end

    def finish_template
      invoke :hightail_customization
      super
    end

    def hightail_customization
      build :rvm unless options[:skip_rvm]
      build :rspec unless options[:skip_rspec]
      build :generators
      build :stylesheets
      build :lib_app_name
      build :remove_public_index
      build :remove_rails_logo
    end

    protected

    def self.banner
{'fraction_non_alphanumeric': 0.09698879551820729, 'fraction_numerical': 0.0007002801120448179, 'mean_word_length': 2.7691292875989446, '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': '5550710', 'n_tokens_mistral': 888, 'n_tokens_neox': 853, 'n_words': 243}