Close tempfiles before editing [Fixes #575]

This commit is contained in:
Conrad Irwin 2012-05-19 23:49:30 -07:00
parent eb5b8eb8ee
commit 6a971f1060
1 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,7 @@ class Pry
f.puts(content) f.puts(content)
f.flush f.flush
reload = !opts.present?(:'no-reload') && !Pry.config.disable_auto_reload reload = !opts.present?(:'no-reload') && !Pry.config.disable_auto_reload
f.close(false)
invoke_editor(f.path, line, reload) invoke_editor(f.path, line, reload)
if reload if reload
silence_warnings do silence_warnings do
@ -209,6 +210,7 @@ class Pry
temp_file do |f| temp_file do |f|
f.puts lines.join f.puts lines.join
f.flush f.flush
f.close(false)
invoke_editor(f.path, 0, true) invoke_editor(f.path, 0, true)
if @method.alias? if @method.alias?