Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Nov 15, 2025

This fixes an issue I was having with rubocop in vscode.

The ruby lsp setup in vscode is now much simpler, since it uses the same ruby setup commands we use for other shell commands, so hopefully future changes will be less destructive.

As part of this, I added a new ruby helper function to run brew install-bundler-gems if needed, which is used a few times by shell commands and the ruby lsp setup

Copilot AI review requested due to automatic review settings November 15, 2025 19:28
@Rylan12 Rylan12 enabled auto-merge November 15, 2025 19:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors Ruby setup and bundler gem installation to use a new shared helper function ensure-bundle-dependencies(). This simplifies the code and makes the VSCode Ruby LSP setup more maintainable by reusing the same setup functions used elsewhere.

Key Changes:

  • Added ensure-bundle-dependencies() function in utils/ruby.sh to centralize bundle dependency checking and installation
  • Refactored rubocop.sh and setup-ruby.sh to use the new helper function
  • Simplified .vscode/ruby-lsp-activate.sh to use standard Ruby setup functions instead of custom logic

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/utils/ruby.sh Added ensure-bundle-dependencies() helper function that checks bundle status and runs install-bundler-gems with appropriate flags
Library/Homebrew/dev-cmd/rubocop.sh Replaced inline bundle check and install logic with call to ensure-bundle-dependencies()
Library/Homebrew/cmd/setup-ruby.sh Replaced inline bundle check and install logic with call to ensure-bundle-dependencies()
.vscode/ruby-lsp-activate.sh Refactored to use standard Ruby setup functions (setup-ruby-path, setup-gem-home-bundle-gemfile, ensure-bundle-dependencies) instead of calling brew directly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

@Rylan12 Rylan12 added this pull request to the merge queue Nov 16, 2025
Merged via the queue into main with commit 586a4ec Nov 16, 2025
37 checks passed
@Rylan12 Rylan12 deleted the fix-vscode-rubocop branch November 16, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants