Skip to content

Commit a6287f7

Browse files
committed
Move detection logic to the RubyInstaller class
1 parent b011899 commit a6287f7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

vscode/src/ruby.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import path from "path";
2-
import os from "os";
32

43
import * as vscode from "vscode";
54

@@ -328,11 +327,6 @@ export class Ruby implements RubyInterface {
328327
}
329328
}
330329

331-
if (os.platform() === "win32") {
332-
this.versionManager = ManagerIdentifier.RubyInstaller;
333-
return;
334-
}
335-
336330
// If we can't find a version manager, just return None
337331
this.versionManager = ManagerIdentifier.None;
338332
}

vscode/src/ruby/rubyInstaller.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ interface RubyVersion {
1616
//
1717
// If we can't find it there, then we throw an error and rely on the user to manually select where Ruby is installed.
1818
export class RubyInstaller extends Chruby {
19+
// eslint-disable-next-line @typescript-eslint/require-await
20+
static async detect(
21+
_workspaceFolder: vscode.WorkspaceFolder,
22+
_outputChannel: vscode.LogOutputChannel,
23+
): Promise<vscode.Uri | undefined> {
24+
return os.platform() === "win32" ? vscode.Uri.file("RubyInstaller") : undefined;
25+
}
26+
1927
// Environment variables are case sensitive on Windows when we access them through NodeJS. We need to ensure that
2028
// we're searching through common variations, so that we don't accidentally miss the path we should inherit
2129
protected getProcessPath() {

0 commit comments

Comments
 (0)