Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the config loader Bundler-aware
Before this change, when inheriting a configuration from a gem, rubocop: 1. would fail to find it, if the gem specified in the Gemfile has a `path` or `git` option (because rubygems is unaware of those gems) 2. would always load the config of the latest installed version of a gem, regardless of the version specified in the Gemfile This commit changes that, so if executed in the context of Bundler (`defined?(Bundler)`) it will first try to get the gem path via Bundler, and fallback to the previous `Gem::Specification` path when not found. This solves the two mentioned issues while maintaining the possibility to run rubocop in a globally installed context, i.e. without Bundler.
- Loading branch information
Showing
3 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters