From: Matthew MacLean <archenoth@gmail.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby
Date: Wed, 12 Aug 2015 14:05:16 -0600 [thread overview]
Message-ID: <CA+GZiYq_vxWHm2xAOuZHiG0omkACrS+qhXWga=4MGuUvv52_BQ@mail.gmail.com> (raw)
In-Reply-To: <87oaic4e3e.fsf@kyleam.com>
[-- Attachment #1.1: Type: text/plain, Size: 1553 bytes --]
In that case... Here is another patch with your suggestions.
Thanks for taking the time to point out all that..! I'll be sure to keep it
all in mind if I submit something else later.
On Wed, Aug 12, 2015 at 11:21 AM, Kyle Meyer <kyle@kyleam.com> wrote:
> Matthew MacLean <archenoth@gmail.com> writes:
>
> > Alright, done. Is this acceptable? (Provided that tests don't count
> towards
> > line count, of course)
>
> Thanks. A few minor comments on the commit message.
>
> > Subject: [PATCH] ob-ruby: Fix double-escaping
> >
> > * lisp/ob-ruby.el: Remove second call to
> > `org-babel-ruby-table-or-string' in `org-babel-ruby-evaluate'.
>
> Please add the name of the changed function in parentheses after the
> file name rather than putting it in the description body.
>
> > * testing/lisp/test-ob-ruby.el: Add test to verify
> > `org-babel-execute:ruby' can evaluate Ruby code. (What the
> > double-escape prevented)
>
> Same here for the test name. "Add test." for description would do.
>
> > I removed the escaping from `org-babel-ruby-evaluate', because the only
> > place `org-babel-ruby-evaluate' is ever called is in
> > `org-babel-execute:ruby'.
> >
> > In this function, its result either escaped (Where the double escape
> > previously occurred) or passed in as the "scalar-form" of
> > `org-babel-result-cond', which handles the "pp" and "code" parameters.
> > (A place that doesn't need escaping.)
>
> I think the above two paragraphs could be replaced by a link to this ML
> post.
>
> Thanks for working on this.
>
> --
> Kyle
>
[-- Attachment #1.2: Type: text/html, Size: 2189 bytes --]
[-- Attachment #2: 0001-ob-ruby-Fix-double-escaping.patch --]
[-- Type: text/x-patch, Size: 2073 bytes --]
From 17447319eee53fbfcc6123c384842dd7fd04e3b8 Mon Sep 17 00:00:00 2001
From: Archenoth <archenoth@gmail.com>
Date: Tue, 11 Aug 2015 23:59:25 -0600
Subject: [PATCH] ob-ruby: Fix double-escaping
* lisp/ob-ruby.el (org-babel-ruby-evaluate): Remove second call to
`org-babel-ruby-table-or-string'.
* testing/lisp/test-ob-ruby.el (org-babel-ruby-evaluate): Add test.
<http://permalink.gmane.org/gmane.emacs.orgmode/99888>
TINYCHANGE
---
lisp/ob-ruby.el | 6 +-----
testing/lisp/test-ob-ruby.el | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el
index 9b01dbf..0ff460e 100644
--- a/lisp/ob-ruby.el
+++ b/lisp/ob-ruby.el
@@ -201,11 +201,7 @@ return the value of the last statement in BODY, as elisp."
org-babel-ruby-pp-wrapper-method
org-babel-ruby-wrapper-method)
body (org-babel-process-file-name tmp-file 'noquote)))
- (let ((raw (org-babel-eval-read-file tmp-file)))
- (if (or (member "code" result-params)
- (member "pp" result-params))
- raw
- (org-babel-ruby-table-or-string raw))))))
+ (org-babel-eval-read-file tmp-file))))
;; comint session evaluation
(case result-type
(output
diff --git a/testing/lisp/test-ob-ruby.el b/testing/lisp/test-ob-ruby.el
index eb5233b..576cb13 100644
--- a/testing/lisp/test-ob-ruby.el
+++ b/testing/lisp/test-ob-ruby.el
@@ -21,6 +21,23 @@
(unless (featurep 'ob-ruby)
(signal 'missing-test-dependency "Support for Ruby code blocks"))
+(ert-deftest test-ob-ruby/basic-evaluation ()
+ "Test that basic evaluation works."
+ (should (equal (org-test-with-temp-text "#+begin_src ruby
+ 2 + 2
+#+end_src"
+ (org-babel-execute-maybe)
+ (substring-no-properties
+ (buffer-string)))
+ "#+begin_src ruby
+ 2 + 2
+#+end_src
+
+#+RESULTS:
+: 4
+
+")))
+
(ert-deftest test-ob-ruby/session-output-1 ()
(should (equal (org-test-with-temp-text "#+begin_src ruby :session :results output
s = \"1\"
--
2.5.0
next prev parent reply other threads:[~2015-08-12 20:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 20:52 fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby Matthew MacLean
2015-08-11 22:33 ` Kyle Meyer
2015-08-11 22:36 ` Kyle Meyer
2015-08-11 22:46 ` Matthew MacLean
2015-08-12 0:52 ` Kyle Meyer
2015-08-12 3:24 ` Matthew MacLean
2015-08-12 5:53 ` Kyle Meyer
2015-08-12 6:18 ` Matthew MacLean
2015-08-12 17:21 ` Kyle Meyer
2015-08-12 20:05 ` Matthew MacLean [this message]
2015-08-13 3:41 ` Kyle Meyer
2015-08-13 4:02 ` Matthew MacLean
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+GZiYq_vxWHm2xAOuZHiG0omkACrS+qhXWga=4MGuUvv52_BQ@mail.gmail.com' \
--to=archenoth@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=kyle@kyleam.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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).