aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2012-12-22 12:48:53 -0600
committerJack Nagel2012-12-22 12:48:53 -0600
commitd2d4813a07ccc077690bb86e522744fa19d2bdd4 (patch)
treec557646be41099390b17312d902ee42b1e90479e
parent4e9128aa6ce8b4086e59b6433030e2996533d595 (diff)
downloadbrew-d2d4813a07ccc077690bb86e522744fa19d2bdd4.tar.bz2
doctor: add helper for printing file listings
-rw-r--r--Library/Homebrew/cmd/doctor.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index ca388d467..752f80930 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -64,6 +64,10 @@ end
found + relative_paths.map{|f| File.join(prefix, f) }.select{|f| File.exist? f }
end
end
+
+ def inject_file_list(list, str)
+ list.inject(str) { |s, f| s << " #{f}\n" }
+ end
############# END HELPERS
# See https://github.com/mxcl/homebrew/pull/9986
@@ -113,8 +117,7 @@ def check_for_stray_dylibs
Unexpected dylibs:
EOS
- bad_dylibs.each { |f| s << " #{f}" }
- s
+ inject_file_list(bad_dylibs, s)
end
def check_for_stray_static_libs
@@ -137,8 +140,7 @@ def check_for_stray_static_libs
Unexpected static libraries:
EOS
- bad_alibs.each{ |f| s << " #{f}" }
- s
+ inject_file_list(bad_alibs, s)
end
def check_for_stray_pcs
@@ -158,8 +160,7 @@ def check_for_stray_pcs
Unexpected .pc files:
EOS
- bad_pcs.each{ |f| s << " #{f}" }
- s
+ inject_file_list(bad_pcs, s)
end
def check_for_stray_las
@@ -180,8 +181,7 @@ def check_for_stray_las
Unexpected .la files:
EOS
- bad_las.each{ |f| s << " #{f}" }
- s
+ inject_file_list(bad_las, s)
end
def check_for_other_package_managers
@@ -548,7 +548,7 @@ def check_for_gettext
These files can cause compilation and link failures, especially if they
are compiled with improper architectures. Consider removing these files:
EOS
- @found.inject(s) { |s, f| s << " #{f}\n" }
+ inject_file_list(@found, s)
end
def check_for_iconv
@@ -572,7 +572,7 @@ def check_for_iconv
tl;dr: delete these files:
EOS
- @found.inject(s){|s, f| s << " #{f}\n" }
+ inject_file_list(@found, s)
end
end
end