Class: Integral::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Integral::Generators::InstallGenerator
- Defined in:
- lib/generators/integral/install_generator.rb
Overview
Runs setup for an Integral Application
Instance Method Summary collapse
-
#copy_initializer_files ⇒ Object
Copies over necessary initialiser files.
-
#copy_migrations ⇒ Object
Copy required migrations.
-
#copy_routes ⇒ Object
Copies routes file.
-
#copy_seeding ⇒ Object
Copies seeding file.
-
#install_message ⇒ Object
Output successful install message.
-
#setup_database ⇒ Object
Create, migrate and run setup on database - setup is incase DB was already present.
Instance Method Details
#copy_initializer_files ⇒ Object
Copies over necessary initialiser files
10 11 12 13 |
# File 'lib/generators/integral/install_generator.rb', line 10 def copy_initializer_files copy_file 'integral.rb', 'config/initializers/integral.rb' copy_file 'sitemap.rb', 'config/sitemap.rb' end |
#copy_migrations ⇒ Object
Copy required migrations
26 27 28 29 30 |
# File 'lib/generators/integral/install_generator.rb', line 26 def copy_migrations rake 'integral:install:migrations' rake 'block_editor:install:migrations' rake 'active_storage:install' end |
#copy_routes ⇒ Object
Copies routes file
16 17 18 |
# File 'lib/generators/integral/install_generator.rb', line 16 def copy_routes copy_file 'routes.rb', 'config/routes.rb' end |
#copy_seeding ⇒ Object
Copies seeding file
21 22 23 |
# File 'lib/generators/integral/install_generator.rb', line 21 def copy_seeding copy_file 'seeds.rb', 'db/seeds.rb' end |
#install_message ⇒ Object
Output successful install message
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/generators/integral/install_generator.rb', line 40 def puts ' --------------------------------------------------------------------' puts ' Integral has successfully installed! ' puts puts " The admin backend is located at /#{Integral.backend_namespace}." puts puts " User email : #{Integral::User.first.email}" puts ' User password : password' puts ' --------------------------------------------------------------------' end |
#setup_database ⇒ Object
Create, migrate and run setup on database - setup is incase DB was already present
33 34 35 36 37 |
# File 'lib/generators/integral/install_generator.rb', line 33 def setup_database rake 'db:create' rake 'db:migrate' rake 'db:setup' end |