MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / detect

Function detect

src/resolution/frameworks/ruby.ts:22–39  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

readFileMethod · 0.80
fileExistsMethod · 0.80

Tested by

no test coverage detected