Top Level Namespace

Includes:
FileTest, FileUtils

Defined Under Namespace

Modules: FubuRake, Nuget, Platform Classes: FubuDocs, MSBuildRunner, NUnitRunner

Instance Method Summary collapse

Instance Method Details

#cleanDirectory(dir) ⇒ Object



383
384
385
386
387
388
389
390
391
392
393
# File 'lib/fuburake.rb', line 383

def cleanDirectory(dir)
  if exists?(dir)
    puts 'Cleaning directory ' + dir
    FileUtils.rm_rf dir;
    waitfor { !exists?(dir) }
  end
  
  if dir == 'artifacts'
    Dir.mkdir 'artifacts'
  end
end

#cleanFile(file) ⇒ Object



395
396
397
# File 'lib/fuburake.rb', line 395

def cleanFile(file)
  File.delete file unless !File.exist?(file)
end

#copyOutputFiles(fromDir, filePattern, outDir) ⇒ Object



368
369
370
371
372
# File 'lib/fuburake.rb', line 368

def copyOutputFiles(fromDir, filePattern, outDir)
  Dir.glob(File.join(fromDir, filePattern)){|file|    
  copy(file, outDir) if File.file?(file)
  } 
end

#waitfor(&block) ⇒ Object



374
375
376
377
378
379
380
381
# File 'lib/fuburake.rb', line 374

def waitfor(&block)
  checks = 0
  until block.call || checks >10 
    sleep 0.5
    checks += 1
  end
  raise 'waitfor timeout expired' if checks > 10
end