From 2257ca4e29cfcc64f84ae69b061acdc38e47d1fe Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 30 May 2014 12:38:30 -0500 Subject: [PATCH] Prefer Dir[] to Dir.glob when not passing a block --- Formula/boost.rb | 2 +- Formula/geoip.rb | 2 +- Formula/python3.rb | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Formula/boost.rb b/Formula/boost.rb index ecd9539f509..7b11e52101f 100644 --- a/Formula/boost.rb +++ b/Formula/boost.rb @@ -172,7 +172,7 @@ class Boost < Formula s = '' # ENV.compiler doesn't exist in caveats. Check library availability # instead. - if Dir.glob("#{lib}/libboost_log*").empty? + if Dir["#{lib}/libboost_log*"].empty? s += <<-EOS.undent Building of Boost.Log is disabled because it requires newer GCC or Clang. diff --git a/Formula/geoip.rb b/Formula/geoip.rb index 77ab30bb697..c3db62e56e5 100644 --- a/Formula/geoip.rb +++ b/Formula/geoip.rb @@ -52,7 +52,7 @@ class Geoip < Formula # Since default data directory moved, copy existing DBs legacy_data = Pathname.new "#{HOMEBREW_PREFIX}/share/GeoIP" - cp Dir.glob("#{legacy_data}/*"), geoip_data if legacy_data.exist? + cp Dir["#{legacy_data}/*"], geoip_data if legacy_data.exist? ["City", "Country"].each do |type| full = Pathname.new "#{geoip_data}/GeoIP#{type}.dat" diff --git a/Formula/python3.rb b/Formula/python3.rb index 5166c6d1044..96162e3b0f2 100644 --- a/Formula/python3.rb +++ b/Formula/python3.rb @@ -111,9 +111,7 @@ class Python3 < Formula system "make", "quicktest" if build.include? "quicktest" # Any .app get a " 3" attached, so it does not conflict with python 2.x. - Dir.glob(prefix/"*.app").each do |app| - mv app, app.gsub(".app", " 3.app") - end + Dir.glob("#{prefix}/*.app") { |app| mv app, app.sub(".app", " 3.app") } # A fix, because python and python3 both want to install Python.framework # and therefore we can't link both into HOMEBREW_PREFIX/Frameworks