<commit_before>module Brightcontent
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path("../templates", __FILE__)

      desc "Creates a Brightcontent initializer, copy migrations, edit routes file"

      def self.next_migration_number(path)
        Time.now.utc.strftime("%Y%m%d%H%M%S")
      end

      def copy_initializer
        template "initializer.rb", "config/initializers/brightcontent.rb"
      end

      def copy_migrations
        rake "brightcontent:install:migrations"
      end

      def generate_default_user
        migration_template "add_default_user.rb", "db/migrate/add_default_user.brightcontent.rb"
      end

      def add_routes
        route "brightcontent_namespace 'admin' do\n" \
        "    #resources :vacancies  #for example\n" \
        "  end"
      end

      def copy_custom_assets
        copy_file "../../../../app/assets/stylesheets/brightcontent/custom.css", "app/assets/stylesheets/brightcontent/custom.css"
        copy_file "../../../../app/assets/javascripts/brightcontent/custom.js", "app/assets/javascripts/brightcontent/custom.js"
      end
<commit_msg>Update install generator with new brightcontent_resources block<commit_after>module Brightcontent
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path("../templates", __FILE__)

      desc "Creates a Brightcontent initializer, copy migrations, edit routes file"

      def self.next_migration_number(path)
        Time.now.utc.strftime("%Y%m%d%H%M%S")
      end

      def copy_initializer
        template "initializer.rb", "config/initializers/brightcontent.rb"
      end

      def copy_migrations
        rake "brightcontent:install:migrations"
      end

      def generate_default_user
        migration_template "add_default_user.rb", "db/migrate/add_default_user.brightcontent.rb"
      end

      def add_routes
        route "brightcontent_resources do\n" \
        "    #resources :vacancies  #for example\n" \
        "  end"
      end

      def copy_custom_assets
        copy_file "../../../../app/assets/stylesheets/brightcontent/custom.css", "app/assets/stylesheets/brightcontent/custom.css"
        copy_file "../../../../app/assets/javascripts/brightcontent/custom.js", "app/assets/javascripts/brightcontent/custom.js"
      end

{'fraction_non_alphanumeric': 0.10775510204081633, 'fraction_numerical': 0.0, 'mean_word_length': 2.865930599369085, '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': '4733369', 'n_tokens_mistral': 731, 'n_tokens_neox': 704, 'n_words': 133}