# File test/bench/benchmarks.rb, line 112 def in_temp_dir(remove_after = true) filename = 'git_test' + Time.now.to_i.to_s + rand(300).to_s.rjust(3, '0') tmp_path = File.join("/tmp/", filename) FileUtils.mkdir(tmp_path) Dir.chdir tmp_path do FileUtils.cp_r(@wbare, File.join(tmp_path, '.git')) yield tmp_path end puts tmp_path #FileUtils.rm_r(tmp_path) if remove_after end