Address style issues related to use of Dir[]

This commit is contained in:
Jack Nagel 2014-05-31 10:05:36 -05:00
parent 2789faf2a7
commit de50833a2b
7 changed files with 10 additions and 18 deletions

View file

@ -55,10 +55,10 @@ class IscDhcp < Formula
# rename all the installed sample etc/* files so they don't clobber
# any existing config files at symlink time.
Dir.open(prefix+'etc') do |dir|
Dir.open("#{prefix}/etc") do |dir|
dir.each do |f|
file = "#{dir.path}/#{f}"
File.rename(file, "#{file}.sample") if File.stat(file).file?
File.rename(file, "#{file}.sample") if File.file?(file)
end
end

View file

@ -10,11 +10,7 @@ class Play < Formula
def install
system "./framework/build", "publish-local" if build.head?
# remove Windows .bat files
rm Dir['*.bat']
rm Dir["#{buildpath}/**/*.bat"] if build.head?
rm_rf Dir["**/*.bat"]
libexec.install Dir['*']
bin.install_symlink libexec/'play'
end

View file

@ -24,7 +24,7 @@ class Salt < Formula
ENV.deparallelize
# the libgfortran.a path needs to be set explicitly
libgfortran = `$FC --print-file-name libgfortran.a`.chomp
ENV.append 'LDFLAGS', "-L#{File.dirname libgfortran} -lgfortran"
ENV.append 'LDFLAGS', "-L#{File.dirname(libgfortran)} -lgfortran"
system "./configure", "--prefix=#{prefix}", "--disable-static"
system "make install"
# install all the model data
@ -35,7 +35,7 @@ class Salt < Formula
test do
ENV['SALTPATH'] = "#{prefix}/data"
cp_r Dir[prefix + '03d4ag' + '*'], '.'
cp_r Dir["#{prefix}/03d4ag*"], '.'
system bin/"snfit", testpath/"lc-03D4ag.list"
assert File.exist?("result_salt2.dat")
end

View file

@ -84,8 +84,8 @@ class Sbcl < Formula
bootstrap = (build.build_32_bit? || !MacOS.prefer_64_bit?) ? "bootstrap32" : "bootstrap64"
resource(bootstrap).stage do
# We only need the binaries for bootstrapping, so don't install anything:
command = Dir.pwd + "/src/runtime/sbcl"
core = Dir.pwd + "/output/sbcl.core"
command = "#{Dir.pwd}/src/runtime/sbcl"
core = "#{Dir.pwd}/output/sbcl.core"
xc_cmdline = "#{command} --core #{core} --disable-debugger --no-userinit --no-sysinit"
cd buildpath do

View file

@ -48,7 +48,7 @@ class Sleepwatcher < Formula
but read information regarding setup of the launchd files which
are installed here:
#{Dir[(prefix + '*.plist')].join("\n ")}
#{Dir["#{prefix}/*.plist"].join("\n ")}
These are the examples provided by the author.
EOS

View file

@ -6,12 +6,8 @@ class TypesafeActivator < Formula
sha1 '01accd921068a4f8dae4a6304aa98f837b110602'
def install
# remove Windows .bat files
rm Dir['*.bat']
rm Dir["#{buildpath}/**/*.bat"]
rm Dir["*.bat"] # Remove Windows .bat files
prefix.install_metafiles
libexec.install Dir['*']
bin.write_exec_script libexec/'activator'
end

View file

@ -9,7 +9,7 @@ class Uru < Formula
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/bitbucket.org/jonforums/uru").install Dir[buildpath/"*"]
(buildpath/"src/bitbucket.org/jonforums/uru").install Dir["*"]
system "go", "build", "-ldflags", "-s", "bitbucket.org/jonforums/uru"
bin.install "uru" => "uru_rt"
end