aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-05-21 10:54:24 -0500
committerJack Nagel2014-05-21 10:54:24 -0500
commit4f014836f2a5603a05a6de686ef4a298706111c9 (patch)
tree4e7b574d99838a14bc9ae930c2ff77da7453b0ec /Library
parentc6f1ccc2157012cdbc7a70fa9cf8595a1fb5ac1a (diff)
downloadbrew-4f014836f2a5603a05a6de686ef4a298706111c9.tar.bz2
Prefer pathname methods over regexp matching
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_cellar_checks.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb
index b1b52b28a..a37e6a2d2 100644
--- a/Library/Homebrew/formula_cellar_checks.rb
+++ b/Library/Homebrew/formula_cellar_checks.rb
@@ -40,8 +40,7 @@ module FormulaCellarChecks
def check_jars
return unless f.lib.directory?
-
- jars = f.lib.children.select{|g| g.to_s =~ /\.jar$/}
+ jars = f.lib.children.select { |g| g.extname == ".jar" }
return if jars.empty?
["JARs were installed to \"#{f.lib}\".",
@@ -92,7 +91,8 @@ module FormulaCellarChecks
def check_generic_executables bin
return unless bin.directory?
- generics = bin.children.select { |g| g.to_s =~ /\/(run|service)$/}
+ generic_names = %w[run service]
+ generics = bin.children.select { |g| generic_names.include? g.basename.to_s }
return if generics.empty?
["Generic binaries were installed to \"#{bin}\".",