diff --git a/Formula/couchdb-lucene.rb b/Formula/couchdb-lucene.rb index 8e17a61a22..f9ea6470a8 100644 --- a/Formula/couchdb-lucene.rb +++ b/Formula/couchdb-lucene.rb @@ -18,7 +18,7 @@ class CouchdbLucene < Formula rm_rf Dir["bin/*.bat"] libexec.install Dir["*"] - Dir["#{libexec}/bin/*"].each do |path| + Dir.glob("#{libexec}/bin/*") do |path| bin_name = File.basename(path) (bin+bin_name).write shim_script(bin_name) end diff --git a/Formula/dex2jar.rb b/Formula/dex2jar.rb index 86ce69542c..edb765ee1a 100644 --- a/Formula/dex2jar.rb +++ b/Formula/dex2jar.rb @@ -13,7 +13,7 @@ class Dex2jar < Formula prefix.install_metafiles libexec.install Dir['*'] - Dir["#{libexec}/*.sh"].each do |script| + Dir.glob("#{libexec}/*.sh") do |script| bin.install_symlink script => File.basename(script, '.sh') end end diff --git a/Formula/elixir.rb b/Formula/elixir.rb index 945549b859..d380d5047c 100644 --- a/Formula/elixir.rb +++ b/Formula/elixir.rb @@ -36,7 +36,7 @@ class Elixir < Formula system "make" bin.install Dir['bin/*'] - Dir['bin/*.bat'] - Dir['lib/*/ebin'].each do |path| + Dir.glob("lib/*/ebin") do |path| app = File.basename(File.dirname(path)) (lib/app).install path end diff --git a/Formula/gdal.rb b/Formula/gdal.rb index 99a5768582..b152185652 100644 --- a/Formula/gdal.rb +++ b/Formula/gdal.rb @@ -289,7 +289,7 @@ class Gdal < Formula system 'make', 'man' if build.head? system 'make', 'install-man' # Clean up any stray doxygen files. - Dir[bin + '*.dox'].each { |p| rm p } + Dir.glob("#{bin}/*.dox") { |p| rm p } end def caveats diff --git a/Formula/groovy.rb b/Formula/groovy.rb index e6fffa9d27..8042fc4a95 100644 --- a/Formula/groovy.rb +++ b/Formula/groovy.rb @@ -12,7 +12,7 @@ class Groovy < Formula rm_f Dir["bin/*.bat"] if build.include? 'invokedynamic' - Dir['indy/*.jar'].each do |src_path| + Dir.glob("indy/*.jar") do |src_path| dst_file = File.basename(src_path, '-indy.jar') + '.jar' dst_path = File.join('lib', dst_file) mv src_path, dst_path diff --git a/Formula/jena.rb b/Formula/jena.rb index be678a4a36..9da5fec776 100644 --- a/Formula/jena.rb +++ b/Formula/jena.rb @@ -19,7 +19,7 @@ class Jena < Formula prefix.install %w{ LICENSE ReleaseNotes-Jena.txt NOTICE ReleaseNotes-TDB.txt README ReleaseNotes-ARQ.txt } doc.install ['javadoc-arq', 'javadoc-core', 'javadoc-sdb', 'javadoc-tdb', 'src-examples'] libexec.install Dir['*'] - Dir["#{libexec}/bin/*"].each do |path| + Dir.glob("#{libexec}/bin/*") do |path| bin_name = File.basename(path) (bin+bin_name).write shim_script(bin_name) end diff --git a/Formula/jetty.rb b/Formula/jetty.rb index 6cf3b65c78..169b9a356e 100644 --- a/Formula/jetty.rb +++ b/Formula/jetty.rb @@ -11,12 +11,12 @@ class Jetty < Formula (libexec+'logs').mkpath bin.mkpath - Dir["#{libexec}/bin/*.sh"].each do |f| + Dir.glob("#{libexec}/bin/*.sh") do |f| scriptname = File.basename(f, '.sh') (bin+scriptname).write <<-EOS.undent #!/bin/bash JETTY_HOME=#{libexec} - #{f} $@ + #{f} "$@" EOS chmod 0755, bin+scriptname end diff --git a/Formula/luciddb.rb b/Formula/luciddb.rb index 5ddcaa7dfb..12189ad546 100644 --- a/Formula/luciddb.rb +++ b/Formula/luciddb.rb @@ -21,7 +21,7 @@ class Luciddb < Formula ENV['JAVA_HOME'] = `/usr/libexec/java_home`.chomp system "./install.sh" end - Dir["#{libexec}/bin/*"].each do |b| + Dir.glob("#{libexec}/bin/*") do |b| next if b =~ /classpath.gen/ or b =~ /defineFarragoRuntime/ n = File.basename(b) (bin+n).write shim_script(n) diff --git a/Formula/nss.rb b/Formula/nss.rb index 670b9a6bcf..edff2c4725 100644 --- a/Formula/nss.rb +++ b/Formula/nss.rb @@ -38,22 +38,18 @@ class Nss < Formula # rather than copying the referenced file. cd "../dist" bin.mkdir - Dir["Darwin*/bin/*"].each do |file| + Dir.glob("Darwin*/bin/*") do |file| cp file, bin unless file.include? ".dylib" end include.mkdir include_target = include + "nss" include_target.mkdir - ["dbm", "nss"].each do |dir| - Dir["public/#{dir}/*"].each do |file| - cp file, include_target - end - end + Dir.glob("public/{dbm,nss}/*") { |file| cp file, include_target } lib.mkdir libexec.mkdir - Dir["Darwin*/lib/*"].each do |file| + Dir.glob("Darwin*/lib/*") do |file| cp file, lib unless file.include? ".chk" cp file, libexec if file.include? ".chk" end diff --git a/Formula/shrewsoft-vpn-client.rb b/Formula/shrewsoft-vpn-client.rb index b10d10202b..116ea96810 100644 --- a/Formula/shrewsoft-vpn-client.rb +++ b/Formula/shrewsoft-vpn-client.rb @@ -20,8 +20,7 @@ class ShrewsoftVpnClient < Formula # https://lists.shrew.net/pipermail/vpn-devel/2014-January/000636.html # there is no suport for an alternate Frameworks folder, must change hard-coded paths - ["package/macosx/vpn-client-install.packproj"] + - Dir["source/*/CMakeLists.txt"].each do |path| + Dir.glob(%w[source/*/CMakeLists.txt package/macosx/vpn-client-install.packproj]) do |path| next unless File.read(path).include? "/Library/Frameworks" inreplace path, "/Library/Frameworks", frameworks end @@ -51,7 +50,7 @@ class ShrewsoftVpnClient < Formula system "cmake", *cmake_args # change relative framework paths to absolute ones (otherwise /Library/Frameworks is assumed) - Dir["source/*/cmake_install.cmake"].each do |path| + Dir.glob("source/*/cmake_install.cmake") do |path| inreplace path, /"(ShrewSoft.+?\.framework)/, "\"#{frameworks}/\\1" end