Method: Temp::Tempfile#initialize

Defined in:
lib/temp/tempfile.rb

#initialize(dir, options = {}) ⇒ Tempfile

Load a Tempfile in the specified directory. Options can be passed so that they can be accessed from the Tempfile.



10
11
12
13
14
15
16
17
18
# File 'lib/temp/tempfile.rb', line 10

def initialize(dir, options = {})
  @dir = File.expand_path(dir)
  @file = File.join(@dir, 'Tempfile')
  @options = options
  @info = {}
  @ignore_files = []
  @erb_files = []
  instance_eval File.read(@file) if File.file? @file
end