Class: Vert::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Vert::Generators::InstallGenerator
- Defined in:
- lib/vert/generators/install_generator.rb
Instance Method Summary collapse
- #add_routes ⇒ Object
- #create_application_record ⇒ Object
- #create_current_model ⇒ Object
- #create_health_controller ⇒ Object
- #create_initializer ⇒ Object
- #create_outbox_event_model ⇒ Object
- #create_outbox_migration ⇒ Object
- #show_instructions ⇒ Object
Instance Method Details
#add_routes ⇒ Object
38 39 40 41 42 |
# File 'lib/vert/generators/install_generator.rb', line 38 def add_routes route 'get "/health", to: "health#show"' route 'get "/health/live", to: "health#live"' route 'get "/health/ready", to: "health#ready"' end |
#create_application_record ⇒ Object
21 22 23 |
# File 'lib/vert/generators/install_generator.rb', line 21 def create_application_record template "application_record.rb.tt", "app/models/application_record.rb" end |
#create_current_model ⇒ Object
17 18 19 |
# File 'lib/vert/generators/install_generator.rb', line 17 def create_current_model template "current.rb.tt", "app/models/current.rb" end |
#create_health_controller ⇒ Object
34 35 36 |
# File 'lib/vert/generators/install_generator.rb', line 34 def create_health_controller template "health_controller.rb.tt", "app/controllers/health_controller.rb" end |
#create_initializer ⇒ Object
13 14 15 |
# File 'lib/vert/generators/install_generator.rb', line 13 def create_initializer template "initializer.rb.tt", "config/initializers/vert.rb" end |
#create_outbox_event_model ⇒ Object
25 26 27 |
# File 'lib/vert/generators/install_generator.rb', line 25 def create_outbox_event_model template "outbox_event.rb.tt", "app/models/outbox_event.rb" end |
#create_outbox_migration ⇒ Object
29 30 31 32 |
# File 'lib/vert/generators/install_generator.rb', line 29 def create_outbox_migration migration_template "create_outbox_events.rb.tt", "db/migrate/#{}_create_outbox_events.rb" end |
#show_instructions ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/vert/generators/install_generator.rb', line 44 def show_instructions say "\n" say "Vert installed successfully!", :green say "\n" say "Next steps:", :yellow say "1. Edit config/initializers/vert.rb to enable the features you need" say "2. Run migrations: rails db:migrate" say "3. Include Vert concerns in your models as needed:" say " include Vert::Concerns::UuidPrimaryKey" say " include Vert::Concerns::MultiTenant" say " include Vert::Concerns::Auditable" say " include Vert::Concerns::SoftDeletable" say "\n" end |