diff options
author | Bundlerbot <bot@bundler.io> | 2019-11-05 15:08:35 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-11-05 15:08:35 +0000 |
commit | bf7df421ee6311fcc17e6dc46d204236f33b4b3f (patch) | |
tree | 9ee1a17a12cc49841cca12f7c7e5e9326af9537c | |
parent | 2e7a37b4517767190e227ed93814567f4b12413d (diff) | |
parent | 0698cb1519f4ddad388024cea83867f339219b4c (diff) | |
download | bundler-bf7df421ee6311fcc17e6dc46d204236f33b4b3f.tar.gz |
Merge #7398
7398: Remove unnecessary lines from `bundler/setup` r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
These lines in the `bundler/setup` file are not necessary.
### What was your diagnosis of the problem?
Bundler no longer needs to be in the `$LOAD_PATH` once a version of itself has been loaded.
In any case, the `Metadata` source takes care of adding `bundler` to the index:
https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler/source/metadata.rb#L13-L30
and then that spec is added to the resolution here:
https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler/definition.rb#L180-L184
And from the resulting set of specs, the `$LOAD_PATH` is setup:
https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler/runtime.rb#L25-L38
So `bundler` will be present in the `$LOAD_PATH` anyways, and the lines being removed here will never be useful.
### What is your fix for the problem, implemented in this PR?
My fix is to remove these lines to make the code easier to follow.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | lib/bundler/setup.rb | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index b9a2f8f1da..70a0968f4b 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -19,8 +19,4 @@ if Bundler::SharedHelpers.in_bundle? else Bundler.ui.silence { Bundler.setup } end - - # Add bundler to the load path after disabling system gems - bundler_lib = File.expand_path("../..", __FILE__) - $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib) end |