class FsTemplate::FromCommand

Attributes

command[RW]
path[RW]

Public Instance Methods

with_tmp_dir() { |dir| ... } click to toggle source
# File lib/fs_template/from_command.rb, line 6
def with_tmp_dir
  dir = "/tmp/#{rand(1000000000000000000)}"
  `mkdir #{dir}`
  Dir.chdir(dir) do
    yield dir
  end
ensure
  ec "rm -rf #{dir}", :silent => true
end