# File lib/pry/editor.rb, line 7 def edit_tempfile_with_content(initial_content, line=1) temp_file do |f| f.puts(initial_content) f.flush f.close(false) invoke_editor(f.path, line, true) File.read(f.path) end end
# File lib/pry/editor.rb, line 17 def invoke_editor(file, line, blocking=true) raise CommandError, "Please set Pry.config.editor or export $VISUAL or $EDITOR" unless Pry.config.editor editor_invocation = build_editor_invocation_string(file, line, blocking) return nil unless editor_invocation if jruby? open_editor_on_jruby(editor_invocation) else open_editor(editor_invocation) end end