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



465
466
467
468
469
470
471
472
473
474
475
# File 'lib/fuburake.rb', line 465

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



477
478
479
# File 'lib/fuburake.rb', line 477

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

#copyOutputFiles(fromDir, filePattern, outDir) ⇒ Object



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

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

#waitfor(&block) ⇒ Object



456
457
458
459
460
461
462
463
# File 'lib/fuburake.rb', line 456

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