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



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

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



473
474
475
# File 'lib/fuburake.rb', line 473

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

#copyOutputFiles(fromDir, filePattern, outDir) ⇒ Object



446
447
448
449
450
# File 'lib/fuburake.rb', line 446

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

#waitfor(&block) ⇒ Object



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

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