all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Mike Gauland <mikelygee@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Passing table to Ruby session
Date: Mon, 14 Aug 2023 10:18:46 +0000	[thread overview]
Message-ID: <877cpyq649.fsf@localhost> (raw)
In-Reply-To: <cf567ae3-6a38-4d4b-9a3b-2e7df0ebaac8@gmail.com>

Mike Gauland <mikelygee@gmail.com> writes:

> I've redefined org-babel-ruby-var-to-ruby in my init.el to add a newline 
> after each element in an array, which I think will work for anything 
> less than a 4k-long string. Ideally, the hard-coded \n would follow the 
> EOL convention of the buffer, but I haven't gotten that far yet.
>
>
> (defun org-babel-ruby-var-to-ruby (var)
>    "Convert VAR into a ruby variable.
> Convert an elisp value into a string of ruby source code
> specifying a variable of the same value."
>    (if (listp var)
>        (concat "[" (mapconcat #'org-babel-ruby-var-to-ruby var ", \n") "]")

I think Emacs should handle it automatically.

Also, it looks like ruby sessions are broken now:

#+begin_src ruby :session org-test-ruby :results output
s = "1"
s = "2"
s = "3"
puts s
s = "4"
#+end_src

yields nothing.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2023-08-14 10:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  8:17 Passing table to Ruby session Mike Gauland
2023-08-09 10:14 ` Ihor Radchenko
2023-08-09 19:06   ` Mike Gauland
2023-08-09 21:24     ` Mike Gauland
2023-08-10  4:40       ` Mike Gauland
2023-08-10  9:11       ` Ihor Radchenko
2023-08-11  1:24         ` Mike Gauland
2023-08-11  7:47           ` Ihor Radchenko
2023-08-13 20:26             ` Mike Gauland
2023-08-14 10:18               ` Ihor Radchenko [this message]
2023-08-25 13:19                 ` Ihor Radchenko
2023-08-31  9:58             ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cpyq649.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=mikelygee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.