How can you check for the presence of both Bundler as well as a Gemfile?
My initial guess was defined?(Bundler) && File.exist?('Gemfile')
, but since you can have a Gemfile with a different name, this won’t cover all cases.
This:
Bundler::SharedHelpers.in_bundle?