rubymem / bundler-leak

Known-leaky gems verification for bundler: `bundle leak` to check your app and find leaky gems in your Gemfile :gem::droplet:
https://www.rubymem.com
GNU General Public License v3.0
289 stars 11 forks source link

Use `Bundler.with_unbundled_env` instead of deprecated `with_clean_env` #31

Closed AlexWayfer closed 4 years ago

AlexWayfer commented 4 years ago

For Bundler >= 2.1.0.

There is also can be used with_original_env, but specs are passing with any method and without it at all.

Probably we should add specs that will fail.

bronzdoc commented 4 years ago

Thanks @AlexWayfer!

I agree we should add test for it, but since we were already using with_clean_env I prefer we keep it consistent and replace it with with_unbundled_env.

We don't want unexpected problems due to RUBYOPT or RUBYLIB being set while running bundler leak 😬

AlexWayfer commented 4 years ago

I agree we should add test for it, but since we were already using with_clean_env I prefer we keep it consistent and replace it with with_unbundled_env.

OK, as you wish. I was not sure about which method we should use. Changed.

bronzdoc commented 4 years ago

with_clean_env was deprecated and with_original_env was introduced in Bundler 2.0.0 so i'm not sure what to do about this

AlexWayfer commented 4 years ago

with_clean_env was deprecated and with_original_env was introduced in Bundler 2.0.0 so i'm not sure what to do about this

If you're talking about backward compatibility — I've added a condition like in https://github.com/puma/puma/pull/2151

AlexWayfer commented 4 years ago

You're welcome! Thank you for merging.