aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_cellar_checks.rb
diff options
context:
space:
mode:
authorJack Nagel2014-05-21 10:54:24 -0500
committerJack Nagel2014-05-21 10:54:24 -0500
commit7e2eb6fdf8ec88b54ecf8528e173e1abedb5b09d (patch)
treeb46aaaa5193ecd859d7d826deeadf1fd2e444e56 /Library/Homebrew/formula_cellar_checks.rb
parent625981f2bd8c7f6672e1d66c81e0f59a738eff62 (diff)
downloadhomebrew-7e2eb6fdf8ec88b54ecf8528e173e1abedb5b09d.tar.bz2
Prefer pathname methods over regexp matching
Diffstat (limited to 'Library/Homebrew/formula_cellar_checks.rb')
-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}\".",