Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make and remove new Mongo temp directories.

  • Loading branch information...
commit 657c30acf80affd6c9a175753266ae3ff11522ec 1 parent c426ef3
@bcg authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 Rakefile
View
5 Rakefile
@@ -16,17 +16,16 @@ class MongoRunner
def self.run(options={})
auth = "--auth" if options[:auth]
dir = Dir.tmpdir + "/em-mongo-tests-#$$"
- FileUtils.rm_r Dir.glob("#{dir}/*") unless options[:noclean]
+ FileUtils.mkdir dir
pidf = "#{dir}/mongod.pid"
logf = "#{dir}/mongo.log"
begin
- #puts "mongod run #{auth} --fork -vvvvvvv --dbpath #{dir} --pidfilepath #{pidf} --logpath #{logf} >> /dev/null "
system "mongod run #{auth} --fork -vvvvvvv --dbpath #{dir} --pidfilepath #{pidf} --logpath #{logf} >> /dev/null "
yield if block_given?
ensure
if File.exists?(pidf) and File.read(pidf).to_i != 0
Process.kill("KILL", File.read(pidf).to_i)
- FileUtils.rm_r Dir.glob("#{dir}/*") unless options[:noclean]
+ FileUtils.rm_r dir unless options[:noclean]
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.