Use a defined list of locations to search for bundler version
What does this Merge Request do and why?
Use a pre-defined list of locations to check for the BUNDLED WITH
version, instead of a find .
.
We don't need to install any version older than 2.x, and in 2.x we can safely use the latest as it is backward/foreward compatible.
This version runs much faster.
Before:
bash-3.2$ time find . -type f -name Gemfile.lock -exec awk '/BUNDLED WITH/{getline;print $NF;}' {} + 2> /dev/null | sort -r | uniq
2.2.29
2.1.4
1.17.3
real 0m5.284s
user 0m0.268s
sys 0m5.012s
After:
bash-3.2$ time find ${gemfiles[*]} -type f -name Gemfile.lock -exec awk '/BUNDLED WITH/{getline;print $NF;}' {} + 2> /dev/null | sort -r | head -n 1
2.1.4
real 0m0.013s
user 0m0.008s
sys 0m0.010s
(the projects that are bundled with 2.2.x above will work in 2.1.x. See #1378 (closed) for a list of them)
Fixes #1378 (closed)
Merge Request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise Issue to follow-up. -
Documentation added/updated, if needed. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Gabriel Mazetto