Sha256: f0f61ee8b85816b49ffd17c23ba977601b4ed331f4f064a6e53cdc6879860ff8

Contents?: true

Size: 328 Bytes

Versions: 1

Compression:

Stored size: 328 Bytes

Contents

require 'fileutils'

# runs block in temp dir, purge it after all
def temp_dir temp='tmp/trash'
  FileUtils.rm_rf temp
  FileUtils.mkpath temp
  Dir.chdir(temp) { yield }
  FileUtils.rm_rf temp
end

# mkpath + touch
def mkfile file
  mkdir File.split(file)[0]
  FileUtils.touch file
end

def mkdir dir
  FileUtils.mkpath dir
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dir_processor-0.0.4 spec/support/file_utils.rb