Module: Byebug::SaveFunctions

Defined in:
lib/byebug/commands/save.rb

Overview

Utilities for the save command.

Instance Method Summary collapse

Instance Method Details

#open_saveObject

Create a temporary file to write in if file is nil



7
8
9
10
11
12
13
14
15
# File 'lib/byebug/commands/save.rb', line 7

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