summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Frankel <rick@rickster.com>2016-12-26 15:00:32 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-01 19:55:56 +0100
commit14e3209731097f2b0986aafc8d560252ee30014c (patch)
tree620f0a0359925589c8dba2383b97fa3dba7bd278
parent336bab6ea7b4ad8055ca5b82734c0956e8704080 (diff)
downloadorg-mode-14e3209731097f2b0986aafc8d560252ee30014c.tar.gz
Update ob-ruby for inf-ruby 2.5
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): `run-ruby` has very different semantics in inf-ruby 2.5. Set ruby command to the default which used to be set by `run-ruby` and try and find already existing buffer before invocation.
-rw-r--r--lisp/ob-ruby.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el
index 6415f35..972d566 100644
--- a/lisp/ob-ruby.el
+++ b/lisp/ob-ruby.el
@@ -1,6 +1,6 @@
;;; ob-ruby.el --- Babel Functions for Ruby -*- lexical-binding: t; -*-
-;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2017 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -150,12 +150,16 @@ If there is not a current inferior-process-buffer in SESSION
then create one. Return the initialized session."
(unless (string= session "none")
(require 'inf-ruby)
- (let ((session-buffer (save-window-excursion
- (run-ruby nil session) (current-buffer))))
+ (let* ((cmd (cdr (assoc inf-ruby-default-implementation
+ inf-ruby-implementations)))
+ (buffer (get-buffer (format "*%s*" session)))
+ (session-buffer (or buffer (save-window-excursion
+ (run-ruby cmd session)
+ (current-buffer)))))
(if (org-babel-comint-buffer-livep session-buffer)
(progn (sit-for .25) session-buffer)
- (sit-for .5)
- (org-babel-ruby-initiate-session session)))))
+ (sit-for .5)
+ (org-babel-ruby-initiate-session session)))))
(defvar org-babel-ruby-eoe-indicator ":org_babel_ruby_eoe"
"String to indicate that evaluation has completed.")