Method: Exedit::Editor#open

Defined in:
lib/exedit/editor.rb

#openObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/exedit/editor.rb', line 14

def open
  (file.write(@content) && file.flush) if @content && !@file_path

  system("#{edit_command} #{file.path}")

  result = reload(file).read

  # Remove the tempfile if it exists
  tempfile.unlink if @tempfile

  result
end