Method: Tempfile.path

Defined in:
lib/langhelp/langhelp-sub.rb

.path(content, dir = Dir.tmpdir) ⇒ Object

Create a temporary file whose contents is CONTENT. Returns the file’s path.



147
148
149
150
151
152
153
# File 'lib/langhelp/langhelp-sub.rb', line 147

def path(content, dir=Dir.tmpdir)
  x = Tempfile.open("content", dir)
  x.write content
  x.close
  x.open
  x.path
end