Class: RailsAiBridge::Doctor::Checkers::ViewsChecker
- Inherits:
-
BaseChecker
- Object
- BaseChecker
- RailsAiBridge::Doctor::Checkers::ViewsChecker
- Defined in:
- lib/rails_ai_bridge/doctor/checkers/views_checker.rb
Overview
Verifies +app/views+ contains template files.
Instance Attribute Summary
Attributes inherited from BaseChecker
Instance Method Summary collapse
-
#call ⇒ Doctor::Check
+:pass+ when view files exist; +:warn+ otherwise.
Methods inherited from BaseChecker
Constructor Details
This class inherits a constructor from RailsAiBridge::Doctor::Checkers::BaseChecker
Instance Method Details
#call ⇒ Doctor::Check
Returns +:pass+ when view files exist; +:warn+ otherwise.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rails_ai_bridge/doctor/checkers/views_checker.rb', line 9 def call views_path = File.join(app.root, 'app/views', '**/*') views = Dir.glob(views_path).reject { |f| File.directory?(f) } check( 'Views', views.any?, pass: { message: "#{views.size} view files found" }, fail: { status: :warn, message: 'No view files found in app/views/', fix: 'Views are generated alongside controllers' } ) end |