Prefer Dir.glob when iterating over the result

This commit is contained in:
Jack Nagel 2014-05-31 23:53:36 -05:00
parent 099c8c15ae
commit bf365fc23b
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ module Homebrew extend self
def repair_taps
count = 0
# prune dead symlinks in Formula
Dir["#{HOMEBREW_LIBRARY}/Formula/*.rb"].each do |fn|
Dir.glob("#{HOMEBREW_LIBRARY}/Formula/*.rb") do |fn|
if not File.exist? fn
File.delete fn
count += 1

View File

@ -96,7 +96,7 @@ module Homebrew extend self
def rename_taps_dir_if_necessary
need_repair_taps = false
Dir["#{HOMEBREW_LIBRARY}/Taps/*/"].each do |tapd|
Dir.glob("#{HOMEBREW_LIBRARY}/Taps/*/") do |tapd|
begin
tapd_basename = File.basename(tapd)