From 3e7d1fd1081d52153a4991a733e7b7b6eed212bd Mon Sep 17 00:00:00 2001 From: Joseph Southan Date: Tue, 10 Feb 2026 11:52:51 +0000 Subject: [PATCH] Fix version parsing when bundler outputs diagnostic messages When running `bundle exec rubocop -v`, bundler may output diagnostic messages like "Resolving dependencies" to stdout before the actual RuboCop version number. This caused version detection to fail since the entire stdout was being treated as the version string. Now we extract only the last line of the output, which contains the actual RuboCop version, while ignoring any bundler messages that appear before it. --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index dd5fbe4..fcdda1c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -269,7 +269,7 @@ const requiredGemVersion = '>= 1.53.0'; async function supportedVersionOfRuboCop(command: string): Promise { try { const { stdout } = await promiseExec(`${command} -v`); - const version = stdout.trim(); + const version = stdout.trim().split('\n').pop()?.trim() || stdout.trim(); if (satisfies(version, requiredGemVersion)) { return true; } else {