<commit_before>require 'rails/generators'

module AdminPanel
	module Generators
		class InstallGenerator < ::Rails::Generators::Base
			desc 'Generate basic admin panel with authentication namespaced as Admin'
			source_root ::File.expand_path('../templates', __FILE__)

			class_option :template_engine
			class_option :stylesheet_engine
			class_option :namespace, :type => :string, :default => 'admin', :desc => "Set namespace (default: admin)"
			class_option :skip_turbolinks, :type => :boolean, :default => false, :desc => "Skip Turbolinks on assets"

			def install_devise
				invoke 'devise:install'
			end

			def install_simple_form
				invoke 'simple_form:install', [], ['--bootstrap']
			end

			attr_reader :app_name

			def copy_layout
				@app_name = ::Rails.application.class.to_s.split("::").first.humanize
				template "layouts/admin/application.html.#{options[:template_engine]}", "app/views/layouts/admin/application.html.#{options[:template_engine]}"
				copy_file "layouts/admin/_messages.html.#{options[:template_engine]}", "app/views/layouts/admin/_messages.html.#{options[:template_engine]}"
				copy_file "layouts/admin/_navigation.html.#{options[:template_engine]}", "app/views/layouts/admin/_navigation.html.#{options[:template_engine]}"
			end

			def copy_assets
				directory 'assets', 'app/assets'
			end

			def copy_scaffold
				directory 'controllers', 'app/controllers'
				directory 'views', 'app/views'
			end

			def create_admin_model
				invoke 'active_record:devise', ['admin'], ['--routes', false]
				append_to_file 'db/seeds.rb', %Q(
Admin.create!({ email: '<EMAIL>', password: '<PASSWORD>' })
)
			end
<commit_msg>Minor change to install generator<commit_after>require 'rails/generators'

module AdminPanel
	module Generators
		class InstallGenerator < ::Rails::Generators::Base
			desc 'Generate basic admin panel with authentication namespaced as Admin'
			source_root ::File.expand_path('../templates', __FILE__)

			class_option :template_engine

			def install_devise
				invoke 'devise:install'
			end

			def install_simple_form
				invoke 'simple_form:install', [], ['--bootstrap']
			end

			attr_reader :app_name

			def copy_layout
				@app_name = ::Rails.application.class.to_s.split("::").first.humanize
				extension = "html.#{options[:template_engine]}"

				template "layouts/admin/application.#{extension}", "app/views/layouts/admin/application.#{extension}"
				[ '_messages', '_navigation'].each do |file|
					filename = "#{file}.#{extension}"
					copy_file "layouts/admin/#{filename}", "app/views/layouts/admin/#{filename}"
				end
			end

			def copy_assets
				directory 'assets', 'app/assets'
			end

			def copy_scaffold
				directory 'controllers', 'app/controllers'
				directory 'views', 'app/views'
			end

			def create_admin_model
				invoke 'active_record:devise', ['admin'], ['--routes', false]
				append_to_file 'db/seeds.rb', %Q(
Admin.create!({ email: '<EMAIL>', password: '<PASSWORD>' })
)
			end

{'fraction_non_alphanumeric': 0.14185110663983905, 'fraction_numerical': 0.0, 'mean_word_length': 4.534322820037106, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 13, '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': '412703', 'n_tokens_mistral': 1077, 'n_tokens_neox': 923, 'n_words': 198}