From 321c9712892ba5b292df5b6b12ac38d86f1c496e Mon Sep 17 00:00:00 2001 From: Michael Ludlow Date: Mon, 29 Dec 2025 01:17:49 -0500 Subject: [PATCH] fix(analyzer): move Swift detection before Ruby detection (#401) iOS projects often have a Gemfile for CocoaPods/Fastlane dependencies. The previous detection order checked Ruby first, causing iOS projects to be incorrectly identified as Ruby instead of Swift. This fix moves Swift/iOS detection before Ruby detection in the elif chain to ensure .xcodeproj and Package.swift are checked first. Fixes: iOS projects with Gemfile detected as Ruby Signed-off-by: Black Circle Sentinel --- .../analysis/analyzers/framework_analyzer.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/backend/analysis/analyzers/framework_analyzer.py b/apps/backend/analysis/analyzers/framework_analyzer.py index e39b6bf6..1f438ecd 100644 --- a/apps/backend/analysis/analyzers/framework_analyzer.py +++ b/apps/backend/analysis/analyzers/framework_analyzer.py @@ -75,14 +75,7 @@ class FrameworkAnalyzer(BaseAnalyzer): content = self._read_file("Cargo.toml") self._detect_rust_framework(content) - # Ruby detection - elif self._exists("Gemfile"): - self.analysis["language"] = "Ruby" - self.analysis["package_manager"] = "bundler" - content = self._read_file("Gemfile") - self._detect_ruby_framework(content) - - # Swift/iOS detection + # Swift/iOS detection (check BEFORE Ruby - iOS projects often have Gemfile for CocoaPods/Fastlane) elif self._exists("Package.swift") or any(self.path.glob("*.xcodeproj")): self.analysis["language"] = "Swift" if self._exists("Package.swift"): @@ -91,6 +84,13 @@ class FrameworkAnalyzer(BaseAnalyzer): self.analysis["package_manager"] = "Xcode" self._detect_swift_framework() + # Ruby detection + elif self._exists("Gemfile"): + self.analysis["language"] = "Ruby" + self.analysis["package_manager"] = "bundler" + content = self._read_file("Gemfile") + self._detect_ruby_framework(content) + def _detect_python_framework(self, content: str) -> None: """Detect Python framework.""" from .port_detector import PortDetector