diff options
author | Bundlerbot <bot@bundler.io> | 2019-11-05 15:08:35 +0000 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-07 16:41:43 +0100 |
commit | 62dd38d5d624e66b2dd117dfc848987cf0238597 (patch) | |
tree | e5bb4c4ea7fb3a54496c36081eb2f766fec7ce81 /lib | |
parent | e133e7a8d59c951b86da095fb7b3d5952f854c2d (diff) | |
download | bundler-62dd38d5d624e66b2dd117dfc848987cf0238597.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>
(cherry picked from commit bf7df421ee6311fcc17e6dc46d204236f33b4b3f)
Diffstat (limited to 'lib')
-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 |