From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/3] ruby: filenames: return string array directly
Date: Mon, 27 Mar 2023 15:59:41 -0600 [thread overview]
Message-ID: <20230327215942.13286-3-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20230327215942.13286-1-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
bindings/ruby/filenames.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bindings/ruby/filenames.c b/bindings/ruby/filenames.c
index 17873393..17ec4406 100644
--- a/bindings/ruby/filenames.c
+++ b/bindings/ruby/filenames.c
@@ -23,7 +23,10 @@
VALUE
notmuch_rb_filenames_get (notmuch_filenames_t *fnames)
{
- return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames);
+ VALUE rb_array = rb_ary_new();
+ for (; notmuch_filenames_valid (fnames); notmuch_filenames_move_to_next (fnames))
+ rb_ary_push (rb_array, rb_str_new2 (notmuch_filenames_get (fnames)));
+ return rb_array;
}
/*
--
2.39.2.13.g1fb56cf030
next prev parent reply other threads:[~2023-03-27 22:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 21:59 [PATCH 0/3] ruby: get rid of FileNames object Felipe Contreras
2023-03-27 21:59 ` [PATCH 1/3] ruby: add filenames helper Felipe Contreras
2023-03-27 21:59 ` Felipe Contreras [this message]
2023-03-27 21:59 ` [PATCH 3/3] ruby: remove FileNames object Felipe Contreras
2023-04-12 10:35 ` David Bremner
2023-03-28 0:13 ` [PATCH 0/3] ruby: get rid of " David Bremner
2023-03-28 6:47 ` Felipe Contreras
2023-03-28 6:51 ` Felipe Contreras
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://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230327215942.13286-3-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--cc=notmuch@notmuchmail.org \
/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://yhetil.org/notmuch.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).