summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam Wanninger <ajwann@ajwann.codes>2017-11-27 18:36:03 -0500
committerAdam Wanninger <ajwann@ajwann.codes>2018-01-25 10:01:13 -0500
commit0c9fb52e7ec69b970a554bb2101f746c0226d0fb (patch)
treefbf4116a2c9b64c671ad024d523d6c6d87c8b607 /lib
parent40911ddadbd052e342ebb99ad4188efffc8290c1 (diff)
downloadbundler-0c9fb52e7ec69b970a554bb2101f746c0226d0fb.tar.gz
use Bundler.ui.info instead of exception
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/doctor.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb
index 93366c33a9..95be4bca0b 100644
--- a/lib/bundler/cli/doctor.rb
+++ b/lib/bundler/cli/doctor.rb
@@ -101,25 +101,25 @@ module Bundler
end
def check_for_files_not_owned_by_current_user_but_still_rw
- return unless any_files_not_owned_by_current_user_but_still_rw?
+ return unless files_not_owned_by_current_user_but_still_rw.any?
Bundler.ui.warn "Files exist in Bundler home that are owned by another " \
- "user, but are stil readable/writable"
+ "user, but are stil readable/writable. These files are: #{files_not_owned_by_current_user_but_still_rw.join("\n")}"
end
def check_for_files_not_readable_or_writable
- return unless any_files_not_readable_or_writable?
- raise ProductionError, "Files exist in Bundler home that are not " \
- "readable/writable to the current user"
+ return unless files_not_readable_or_writable.any?
+ Bundler.ui.warn "Files exist in Bundler home that are not " \
+ "readable/writable to the current user. These files are: #{files_not_readable_or_writable.join("\n")}"
end
- def any_files_not_readable_or_writable?
- Find.find(Bundler.home.to_s).any? do |f|
+ def files_not_readable_or_writable
+ Find.find(Bundler.home.to_s).select do |f|
!(File.writable?(f) && File.readable?(f))
end
end
- def any_files_not_owned_by_current_user_but_still_rw?
- Find.find(Bundler.home.to_s).any? do |f|
+ def files_not_owned_by_current_user_but_still_rw
+ Find.find(Bundler.home.to_s).select do |f|
(File.stat(f).uid != Process.uid) &&
(File.writable?(f) && File.readable?(f))
end