tweak variable name in org-babel-ruby

This commit is contained in:
Eric Schulte 2009-06-11 16:28:21 -07:00
parent 2c1b04eecb
commit 0e8ae41dfc
1 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,7 @@ called by `org-babel-execute-src-block'."
(let* ((vars (org-babel-ref-variables params)) (let* ((vars (org-babel-ref-variables params))
(result-params (split-string (or (cdr (assoc :results params)) ""))) (result-params (split-string (or (cdr (assoc :results params)) "")))
(result-type (cond ((member "output" result-params) 'output) (result-type (cond ((member "output" result-params) 'output)
((member "output" result-params) 'value) ((member "value" result-params) 'value)
(t 'value))) (t 'value)))
(full-body (concat (full-body (concat
(mapconcat ;; define any variables (mapconcat ;; define any variables
@ -88,10 +88,10 @@ then create. Return the initialized session."
(defvar org-babel-ruby-eoe-indicator ":org_babel_ruby_eoe" (defvar org-babel-ruby-eoe-indicator ":org_babel_ruby_eoe"
"Used to indicate that evaluation is has completed.") "Used to indicate that evaluation is has completed.")
(defun org-babel-ruby-evaluate (buffer body &optional to-return) (defun org-babel-ruby-evaluate (buffer body &optional result-type)
"Pass BODY to the Ruby process in BUFFER. If TO-RETURN equals "Pass BODY to the Ruby process in BUFFER. If RESULT-TYPE equals
'output then return a list of the outputs of the statements in 'output then return a list of the outputs of the statements in
BODY, if TO-RETURN equals 'value then return the value of the BODY, if RESULT-TYPE equals 'value then return the value of the
last statement in BODY." last statement in BODY."
(org-babel-comint-in-buffer buffer (org-babel-comint-in-buffer buffer
(let ((string-buffer "") (let ((string-buffer "")
@ -119,7 +119,7 @@ last statement in BODY."
;; split results with `comint-prompt-regexp' ;; split results with `comint-prompt-regexp'
(setq results (cdr (member org-babel-ruby-eoe-indicator (setq results (cdr (member org-babel-ruby-eoe-indicator
(reverse (mapcar #'org-babel-trim (split-string string-buffer comint-prompt-regexp)))))) (reverse (mapcar #'org-babel-trim (split-string string-buffer comint-prompt-regexp))))))
(case to-return (case result-type
(output (mapconcat #'identity (reverse (cdr results)) "\n")) (output (mapconcat #'identity (reverse (cdr results)) "\n"))
(value (car results)) (value (car results))
(t (reverse results)))))) (t (reverse results))))))