aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-06-19 19:32:37 -0500
committerJack Nagel2014-06-19 19:32:37 -0500
commitd9c586e201b6d5ebfd7ccfe466808a2214494c0f (patch)
tree459a3caadefcadf1127a954479e5aa1aeeed55c5 /Library/Homebrew
parentc4cdd2b7ac2b55ffcba227e43e67a7462229ecf4 (diff)
downloadbrew-d9c586e201b6d5ebfd7ccfe466808a2214494c0f.tar.bz2
Remove unnecessary string evals from doctor
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/doctor.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 57c8b1289..48c86af0a 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -377,20 +377,19 @@ def check_access_usr_local
end
%w{include etc lib lib/pkgconfig share}.each do |d|
- class_eval <<-EOS, __FILE__, __LINE__ + 1
- def check_access_#{d.sub("/", "_")}
- if (dir = HOMEBREW_PREFIX+'#{d}').exist? && !dir.writable_real?
- <<-EOF.undent
- \#{dir} isn't writable.
- This can happen if you "sudo make install" software that isn't managed by
- by Homebrew. If a brew tries to write a file to this directory, the
- install will fail during the link step.
-
- You should probably `chown` \#{dir}
- EOF
- end
+ define_method("check_access_#{d.sub("/", "_")}") do
+ dir = HOMEBREW_PREFIX.join(d)
+ if dir.exist? && !dir.writable_real? then <<-EOS.undent
+ #{dir} isn't writable.
+
+ This can happen if you "sudo make install" software that isn't managed by
+ by Homebrew. If a formula tries to write a file to this directory, the
+ install will fail during the link step.
+
+ You should probably `chown` #{dir}
+ EOS
end
- EOS
+ end
end
def check_access_logs