From 7e2eb6fdf8ec88b54ecf8528e173e1abedb5b09d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 21 May 2014 10:54:24 -0500 Subject: Prefer pathname methods over regexp matching --- Library/Homebrew/formula_cellar_checks.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Library') 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}\".", -- cgit v1.2.3