faf 7.5.1 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Ruby detection — CONTENT-AWARE Gemfile / gemspec classification.
3
+ *
4
+ * Kill line: Gemfile alone ≠ Rails.
5
+ * Bundler backs libraries, Rails apps, Sinatra/Roda/Grape/Hanami, CLIs, and MCP
6
+ * servers. We read gem names (+ light layout), then branch.
7
+ *
8
+ * Same composition as go.ts / jvm.ts: knowledge in ruby-detection.json.
9
+ */
10
+ export type RubyAppType = 'mcp' | 'backend' | 'cli' | 'library';
11
+ export interface RubyProject {
12
+ appType: RubyAppType;
13
+ /** Primary framework label (Rails / Sinatra / …) or ''. */
14
+ framework: string;
15
+ /** package manager signal */
16
+ packageManager: 'bundler' | 'rubygems';
17
+ /** Glass Hood rationale for .faf `# found:`. */
18
+ found: string;
19
+ }
20
+ /** True if directory looks like a Ruby project root. */
21
+ export declare function isRubyRoot(dir: string): boolean;
22
+ /**
23
+ * Extract gem names from a Gemfile / gems.rb (static — does NOT execute Ruby).
24
+ * Handles: gem 'x', gem "x", gem :x (rare), gem "x", "1.0"
25
+ */
26
+ export declare function parseGemfileGems(content: string): Set<string>;
27
+ /**
28
+ * Extract gem names from Gemfile.lock SPECS sections (static).
29
+ * Lines like " rails (7.1.0)" under GEM specs.
30
+ */
31
+ export declare function parseGemfileLockGems(content: string): Set<string>;
32
+ /** Gem names from *.gemspec dependency lines (static). */
33
+ export declare function parseGemspecGems(content: string): Set<string>;
34
+ /**
35
+ * Classify a Ruby project from Gemfile / lock / gemspec (+ light layout).
36
+ * Returns null if not a Ruby root.
37
+ */
38
+ export declare function detectRubyProject(dir: string): RubyProject | null;