test/test_commands.rb
# Creates a temporary file with the given content and yield the path
# to this file. The file itself is only available inside the block and
# will be deleted afterwards.
Creates a temporary file with the given content and yield the path
to this file. The file itself is only available inside the block and
will be deleted afterwards.
Creates a temporary file with the given content and yield the path to this file . The file itself is only available inside the block and will be deleted afterwards .
def with_tempfile(content=nil, extname='skim')
    f = Tempfile.new ['skim', ".#{extname}"]
    if content
      f.write content
      f.flush 
      f.rewind
    end
    yield f.path
  ensure
    f.close
    f.unlink
  end
def with_tempfile ( content = nil , extname = 'skim' ) f = Tempfile . new [ 'skim' , ".#{extname}" ] if content f . write content f . flush f . rewind end yield f . path ensure f . close f . unlink end
Creates a temporary file with the given content and yield the path
to this file.
Creates a temporary file with the given content and yield the path to this file .
# ensure content is actually saved to disk
content
<not_specific>
extname
<not_specific>