summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-05-26 01:22:39 +0000
committerColby Swandale <hello@colby.fyi>2018-07-10 23:02:45 +1000
commitc7e3f8ed9375b4ee10775cbae83a68867fff7b4f (patch)
treea56dcfebfd38cd5bcd2f5596e560e22373a3f2b3
parent7ca3ff99cbaa221aec46cd07d5f5a4db17b25f27 (diff)
downloadbundler-c7e3f8ed9375b4ee10775cbae83a68867fff7b4f.tar.gz
Auto merge of #6554 - bundler:segiddins/read-file-error, r=segiddins
Use filesystem_access when reading a Gemfile ### What was the end-user problem that led to this PR? The problem was users would see an issue template when their `Gemfile` did not have read permissions Fixes https://github.com/bundler/bundler/issues/6541 ### What is your fix for the problem, implemented in this PR? My fix is to use `SharedHelpers.filesystem_access` when reading the Gemfile (cherry picked from commit f7ad6118145b19bfe81220bc1070713902a49d8a)
-rw-r--r--lib/bundler.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index b7002db99e..4b97d32f0b 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -407,7 +407,9 @@ EOF
end
def read_file(file)
- File.open(file, "rb", &:read)
+ SharedHelpers.filesystem_access(file, :read) do
+ File.open(file, "rb", &:read)
+ end
end
def load_marshal(data)