Module: Debugger::SaveFunctions

Defined in:
lib/ruby-debug/commands/save.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#open_saveObject

Create a temporary file to write in if file is nil



5
6
7
8
9
10
11
12
13
# File 'lib/ruby-debug/commands/save.rb', line 5

def open_save
  require "tempfile"
  file = Tempfile.new("rdebug-save")
  # We want close to not unlink, so redefine.
  def file.close
    @tmpfile.close if @tmpfile
  end
  return file
end