(context: ResolutionContext)
| 20 | }, |
| 21 | |
| 22 | detect(context: ResolutionContext): boolean { |
| 23 | // Check for Gemfile with rails |
| 24 | const gemfile = context.readFile('Gemfile'); |
| 25 | if (gemfile && gemfile.includes("'rails'")) { |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | // Check for config/application.rb (Rails signature) |
| 30 | if (context.fileExists('config/application.rb')) { |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | // Check for typical Rails directory structure |
| 35 | return ( |
| 36 | context.fileExists('app/controllers/application_controller.rb') || |
| 37 | context.fileExists('config/routes.rb') |
| 38 | ); |
| 39 | }, |
| 40 | |
| 41 | resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 42 | // Pattern 0: route action `controller#action` (from RESTful `resources` or an |
nothing calls this directly
no test coverage detected