Top Level Namespace

Includes:
FileTest, FileUtils

Defined Under Namespace

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

Constant Summary collapse

BUILD_VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#cleanDirectory(dir) ⇒ Object



459
460
461
462
463
464
465
466
467
468
469
# File 'lib/fuburake.rb', line 459

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



471
472
473
# File 'lib/fuburake.rb', line 471

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

#copyOutputFiles(fromDir, filePattern, outDir) ⇒ Object



444
445
446
447
448
# File 'lib/fuburake.rb', line 444

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

#waitfor(&block) ⇒ Object



450
451
452
453
454
455
456
457
# File 'lib/fuburake.rb', line 450

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