# File lib/pry/editor.rb, line 8 def initialize(_pry_) @_pry_ = _pry_ end
# File lib/pry/editor.rb, line 12 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 22 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