On 11/08/23 19:47, Ihor Radchenko wrote:
On Org side, the best we might do is splitting the long command into multiline (if ruby REPL supports line continuation like \ this or similar). Of course, it will be a workaround.

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") "]")
    (if (eq var 'hline)
    org-babel-ruby-hline-to
      (format "%S" var))))