Sha256: 565c021b48510934ac05d0b94eaa7f7a9fdd20636456a4db789a38e2adb294ad
Contents?: true
Size: 658 Bytes
Versions: 4
Compression:
Stored size: 658 Bytes
Contents
module Sprinkle module Verifiers # = Directory Verifier # # Defines a verify which can be used to test the existence of a # directory. module Directory Sprinkle::Verify.register(Sprinkle::Verifiers::Directory) # Tests that the directory <tt>dir</tt> exists. def has_directory(dir) if RUBY_PLATFORM =~ /win32/ dir += "\\" unless dir[-1,1] == "\\" command = "if exist \"#{dir}\" (exit 0) else (exit 1)" command << ' > NUL 2>&1' unless logger.debug? else command = "test -d #{dir}" end @commands << command end end end end
Version data entries
4 entries across 4 versions & 1 rubygems