Class: TalkToYourApp::Generators::HealthCheckGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- TalkToYourApp::Generators::HealthCheckGenerator
- Defined in:
- lib/generators/talk_to_your_app/health_check/health_check_generator.rb
Overview
‘rails g talk_to_your_app:health_check Database` — scaffolds a health check in app/talk_to_your_app/health/. Enable `config.plugin :health` and the check is exposed automatically via `health.list` / `health.run`.
Constant Summary collapse
- CHECKS_DIR =
File.join(TalkToYourApp::APP_DIR, "health")
Instance Method Summary collapse
Instance Method Details
#create_check ⇒ Object
18 19 20 |
# File 'lib/generators/talk_to_your_app/health_check/health_check_generator.rb', line 18 def create_check template "check.rb.tt", File.join(CHECKS_DIR, class_path, "#{file_name}.rb") end |
#show_next_steps ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/generators/talk_to_your_app/health_check/health_check_generator.rb', line 22 def show_next_steps say "" say "Created #{File.join(CHECKS_DIR, class_path, "#{file_name}.rb")} — run it with health.run name: #{file_name.inspect}.", :green say "Make sure config/initializers/talk_to_your_app.rb enables it:" say " config.plugin :health" say "Files here are loaded with require (not Zeitwerk-reloaded) — restart the server to pick up new or edited checks." end |