Skip to content

Commit

Permalink
Handle missing Bundler.with_unbundled_env
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Dec 31, 2020
1 parent fdf0a22 commit c6ba82a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ require 'rubocop/rake_task'

RuboCop::RakeTask.new(:rubocop)

# TODO: Replace this with Bundler.with_unbundled_env
def with_unbundled_env
if Bundler.respond_to?(:with_unbundled_env)
Bundler.with_unbundled_env { yield }
else
Bundler.with_clean_env { yield }
end
end

def sub_sh(dir, cmd)
Bundler.with_unbundled_env do
with_unbundled_env do
Dir.chdir(dir) do
puts "(in #{Dir.getwd})"
sh(cmd)
Expand Down

0 comments on commit c6ba82a

Please sign in to comment.