From 4ef78e68c1796023f5d0b6152c82b8d2f52c0777 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 21 Sep 2014 12:57:44 +0200 Subject: [PATCH] ob-ruby: fix a24775dc79 again * lisp/ob-ruby.el (org-babel-ruby-evaluate): Temporarily disable the irb prompt to ensure that the output is properly recognized using the standard settings from inf-ruby and no extra settings in .irbrc or other configuration files from Ruby. Remove superfluous `comint-send-input' that produced a spurious empty line in output. * testing/lisp/test-ob-ruby.el (test-ob-ruby/session-output): Remove spurious emtpy line in expected output. --- lisp/ob-ruby.el | 6 ++++-- testing/lisp/test-ob-ruby.el | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el index fd59ef477..72196f668 100644 --- a/lisp/ob-ruby.el +++ b/lisp/ob-ruby.el @@ -221,8 +221,10 @@ return the value of the last statement in BODY, as elisp." (mapc (lambda (line) (insert (org-babel-chomp line)) (comint-send-input nil t)) - (list "conf.echo=false" body "conf.echo=true" org-babel-ruby-eoe-indicator)) - (comint-send-input nil t)) 2) + (list "conf.echo=false;_org_prompt_mode=conf.prompt_mode;conf.prompt_mode=:NULL" + body + "conf.prompt_mode=_org_prompt_mode;conf.echo=true" org-babel-ruby-eoe-indicator)) + ) 2) "\n") "[\r\n]")) "\n")) (value (let* ((tmp-file (org-babel-temp-file "ruby-")) diff --git a/testing/lisp/test-ob-ruby.el b/testing/lisp/test-ob-ruby.el index 74cf16354..b3231cd69 100644 --- a/testing/lisp/test-ob-ruby.el +++ b/testing/lisp/test-ob-ruby.el @@ -39,7 +39,6 @@ puts s #+end_src #+RESULTS: -: : 3 "))) -- 2.11.4.GIT