summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/shared_helpers.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 613609f25f..44b9136c0b 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -102,8 +102,10 @@ module Bundler
# end
#
# @see {Bundler::PermissionError}
- def filesystem_access(path, action = :write)
- yield path.dup.untaint
+ def filesystem_access(path, action = :write, &block)
+ # Use block.call instead of yield because of a bug in Ruby 2.2.2
+ # See https://github.com/bundler/bundler/issues/5341 for details
+ block.call(path.dup.untaint)
rescue Errno::EACCES
raise PermissionError.new(path, action)
rescue Errno::EAGAIN