<commit_before># frozen_string_literal: true

require 'thredded_create_app/tasks/base'
module ThreddedCreateApp
  module Tasks
    class AddThredded < Base
      def summary
        'Add and setup Thredded with a User model'
      end

      def before_bundle
        add_gem 'thredded',
                **(ENV['LOCAL_THREDDED'] ? { path: ENV['LOCAL_THREDDED'] } : {})
      end

      def after_bundle # rubocop:disable Metrics/AbcSize
        install_thredded
        git_commit 'Install thredded (rails g thredded:install)'
        add_thredded_routes
        copy 'add_thredded/thredded.en.yml', 'config/locales/thredded.en.yml'
        set_thredded_layout
        configure_thredded_controller
        add_thredded_styles
        add_thredded_javascripts
        copy 'add_thredded/spec/features/thredded_spec.rb',
             'spec/features/thredded_spec.rb'
        git_commit 'Configure Thredded (routes, assets, behaviour, tests)'
        add_admin_column_to_users
        git_commit 'Add the admin column to users'
        setup_thredded_emails
        git_commit 'Configure Thredded emails and email styles with Roadie'
        configure_rails_email_preview
        git_commit 'Configure RailsEmailPreview with Thredded and Roadie'
        run 'bundle exec rails thredded:install:emoji'
        git_commit 'Copied emoji to public/emoji'
      end<commit_msg>No longer install emoji by default<commit_after># frozen_string_literal: true

require 'thredded_create_app/tasks/base'
module ThreddedCreateApp
  module Tasks
    class AddThredded < Base
      def summary
        'Add and setup Thredded with a User model'
      end

      def before_bundle
        add_gem 'thredded',
                **(ENV['LOCAL_THREDDED'] ? { path: ENV['LOCAL_THREDDED'] } : {})
      end

      def after_bundle # rubocop:disable Metrics/AbcSize
        install_thredded
        git_commit 'Install thredded (rails g thredded:install)'
        add_thredded_routes
        copy 'add_thredded/thredded.en.yml', 'config/locales/thredded.en.yml'
        set_thredded_layout
        configure_thredded_controller
        add_thredded_styles
        add_thredded_javascripts
        copy 'add_thredded/spec/features/thredded_spec.rb',
             'spec/features/thredded_spec.rb'
        git_commit 'Configure Thredded (routes, assets, behaviour, tests)'
        add_admin_column_to_users
        git_commit 'Add the admin column to users'
        setup_thredded_emails
        git_commit 'Configure Thredded emails and email styles with Roadie'
        configure_rails_email_preview
        git_commit 'Configure RailsEmailPreview with Thredded and Roadie'
      end
{'fraction_non_alphanumeric': 0.06212349397590362, 'fraction_numerical': 0.0, 'mean_word_length': 2.856313497822932, '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': '968749', 'n_tokens_mistral': 822, 'n_tokens_neox': 816, 'n_words': 188}