From 317dcae93c7b906ca3f450df5a85580c040b5cea Mon Sep 17 00:00:00 2001 From: Jon Ruskin Date: Thu, 9 Sep 2021 19:58:44 -0700 Subject: [PATCH] always reload bundler this is a no-op when bundler is already loaded --- lib/licensed/sources/bundler.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/licensed/sources/bundler.rb b/lib/licensed/sources/bundler.rb index 0e894200..b2a80c3a 100644 --- a/lib/licensed/sources/bundler.rb +++ b/lib/licensed/sources/bundler.rb @@ -109,9 +109,11 @@ def with_application_environment # reset bundler to load from the current app's source path ::Bundler.reset! - ::Bundler.load end + # ensure the bundler environment is loaded before enumeration + ::Bundler.load + yield end ensure @@ -119,8 +121,10 @@ def with_application_environment # restore bundler configuration ENV.replace(backup) ::Bundler.reset! - ::Bundler.load end + + # reload the bundler environment after enumeration + ::Bundler.load end # Returns whether the current licensed execution is running ruby-packer