ソースを参照

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.
Achim Gratz 10 年 前
コミット
4ef78e68c1
2 ファイル変更4 行追加3 行削除
  1. 4 2
      lisp/ob-ruby.el
  2. 0 1
      testing/lisp/test-ob-ruby.el

+ 4 - 2
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-"))

+ 0 - 1
testing/lisp/test-ob-ruby.el

@@ -39,7 +39,6 @@ puts s
 #+end_src
 
 #+RESULTS:
-: 
 : 3
 
 ")))