Class: CmisServer::EngineDiagnostics
- Inherits:
-
Object
- Object
- CmisServer::EngineDiagnostics
- Defined in:
- lib/cmis_server/engine_diagnostics.rb
Overview
Engine diagnostics utilities for testing and troubleshooting
Class Method Summary collapse
-
.diagnostic_info ⇒ Object
Get detailed diagnostics information.
-
.reload_engine_routes! ⇒ Object
Force reload engine routes.
-
.routes_loaded? ⇒ Boolean
Check if engine routes are properly loaded.
Class Method Details
.diagnostic_info ⇒ Object
Get detailed diagnostics information
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cmis_server/engine_diagnostics.rb', line 23 def diagnostic_info { engine_routes_count: CmisServer::Engine.routes.routes.size, engine_routes_loaded: routes_loaded?, engine_controllers: engine_controllers, rails_version: Rails::VERSION::STRING, zeitwerk_enabled: defined?(Zeitwerk) && Rails.autoloaders.main.is_a?(Zeitwerk::Loader), frozen_arrays: check_frozen_arrays } end |
.reload_engine_routes! ⇒ Object
Force reload engine routes
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cmis_server/engine_diagnostics.rb', line 11 def reload_engine_routes! routes_file = File.('../../../config/routes.rb', __FILE__) if File.exist?(routes_file) CmisServer::Engine.routes.clear! load routes_file true else false end end |
.routes_loaded? ⇒ Boolean
Check if engine routes are properly loaded
6 7 8 |
# File 'lib/cmis_server/engine_diagnostics.rb', line 6 def routes_loaded? CmisServer::Engine.routes.routes.any? end |