faf-cli 7.5.0 → 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.
@@ -138,10 +138,11 @@ export interface DetectedFramework {
138
138
  version?: string;
139
139
  }
140
140
  /** Signal types for framework detection */
141
- export type SignalType = 'dependency' | 'file' | 'devDependency';
141
+ export type SignalType = 'dependency' | 'file' | 'devDependency' | 'content';
142
142
  export interface Signal {
143
143
  type: SignalType;
144
144
  key?: string;
145
+ /** File glob/name for `file`/`content`, or package key for dependency types. */
145
146
  pattern?: string;
146
147
  }
147
148
  export interface FrameworkSignature {
@@ -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;