From 5b48284a9fc648867b6d9dca80acb37434b018bf Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 7 Sep 2011 03:00:31 +1200 Subject: [PATCH] first attempt at editor support for jruby --- lib/pry/helpers/command_helpers.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/pry/helpers/command_helpers.rb b/lib/pry/helpers/command_helpers.rb index af2ec874..f8092f3b 100644 --- a/lib/pry/helpers/command_helpers.rb +++ b/lib/pry/helpers/command_helpers.rb @@ -357,7 +357,13 @@ class Pry editor_invocation = "#{Pry.config.editor} #{start_line_syntax_for_editor(file, line)}" end - run ".#{editor_invocation}" + if jruby? + require 'spoon' + pid = Spoon.spawnp(*editor_invocation.split) + Process.waitpid(pid) + else + run ".#{editor_invocation}" + end end def start_line_syntax_for_editor(file_name, line_number)