Skip to content

Commit 67fb917

Browse files
committed
Unbundle the Bundler way
1 parent 778b5fb commit 67fb917

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

features/support/env.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
module ArubaExt
55
def run_command(cmd, timeout = nil)
66
exec_cmd = cmd =~ /^rspec/ ? "bin/#{cmd}" : cmd
7-
# Ensure bundler env vars are unset
8-
unset_bundler_env_vars
9-
delete_environment_variable "BUNDLER_VERSION"
10-
# Ensure the correct Gemfile is found
7+
# Ensure the correct Gemfile and binstubs are found
118
in_current_directory do
12-
super(exec_cmd, timeout)
9+
with_unbundled_env do
10+
super(exec_cmd, timeout)
11+
end
12+
end
13+
end
14+
15+
def with_unbundled_env
16+
if Bundler.respond_to?(:with_unbundled_env)
17+
Bundler.with_unbundled_env { yield }
18+
else
19+
Bundler.with_clean_env { yield }
1320
end
1421
end
1522
end

0 commit comments

Comments
 (0)