--- /dev/null
+Return-Path: <peter.keen@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2F9AC431FBD\r
+ for <notmuch@notmuchmail.org>; Mon, 9 Jul 2012 07:36:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.698\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.698 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+ HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 6fQfvPkki9Y7 for <notmuch@notmuchmail.org>;\r
+ Mon, 9 Jul 2012 07:36:50 -0700 (PDT)\r
+Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com\r
+ [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 4F3A4431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 9 Jul 2012 07:36:50 -0700 (PDT)\r
+Received: by vbbfc26 with SMTP id fc26so8658401vbb.26\r
+ for <notmuch@notmuchmail.org>; Mon, 09 Jul 2012 07:36:48 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=mime-version:sender:date:x-google-sender-auth:message-id:subject\r
+ :from:to:content-type;\r
+ bh=1LnfHk8kfBSq7hDQKMyQtGYeYQhnsH3yc/Yk2gGLuEE=;\r
+ b=C91oXa8e101b/uFQbDbyQmNjhNm90UV+9dfQj29bC+P7As5Pf17cLCI9Abl8sceA9c\r
+ 5zGHkAYeMV99aF8dkbQl9OdSzf7DaabSVGWHKz9moztf0kJ6bF8pwafznJ5FAGNT4eZ5\r
+ HJchO7ZO4GL2ABFPA9KrwMhpQ49i9o0AiBL0VbI1YGKuFVA8PrksOtLaVTFZ05Dam12/\r
+ kkg8v/nxI5XYvbHuDwSpQd97y5/H/Bw6GnKMeQc+NyUcEA7DdkNl/ZptWN9wlAD8BR6K\r
+ XQmPnS46hbXW6M9QmeFXfjA+NO4+cMGKJ5p5EzoGGr8OkkXQTiLMCOw4hMZBqDB351Nw\r
+ +Pyw==\r
+MIME-Version: 1.0\r
+Received: by 10.52.67.134 with SMTP id n6mr16253903vdt.23.1341844608230; Mon,\r
+ 09 Jul 2012 07:36:48 -0700 (PDT)\r
+Sender: peter.keen@gmail.com\r
+Received: by 10.52.169.40 with HTTP; Mon, 9 Jul 2012 07:36:48 -0700 (PDT)\r
+Date: Mon, 9 Jul 2012 07:36:48 -0700\r
+X-Google-Sender-Auth: l_bqwIBvqIxkAzirus5IPYOnQ5U\r
+Message-ID:\r
+ <CAFxm1PkBo2=Jje8OzUXdN6=gD=_Q6cNaNbB4V5eQh4wpd5Ap_Q@mail.gmail.com>\r
+Subject: [PATCH] ruby: add all_tags method to Notmuch::Database\r
+From: Peter Keen <peter.keen@bugsplat.info>\r
+To: notmuch@notmuchmail.org\r
+Content-Type: multipart/alternative; boundary=20cf307f334237a57404c4668b36\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 09 Jul 2012 14:36:51 -0000\r
+\r
+--20cf307f334237a57404c4668b36\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+\r
+The python bindings define a binding for the all_tags method on the\r
+database, which is pretty handy. This commit adds the same binding to\r
+the ruby bindings.\r
+---\r
+ bindings/ruby/database.c | 20 ++++++++++++++++++++\r
+ bindings/ruby/defs.h | 3 +++\r
+ bindings/ruby/init.c | 1 +\r
+ 3 files changed, 24 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c\r
+index e84f726..d5ba108 100644\r
+--- a/bindings/ruby/database.c\r
++++ b/bindings/ruby/database.c\r
+@@ -395,3 +395,23 @@ notmuch_rb_database_query_create (VALUE self, VALUE qstrv)\r
+\r
+ return Data_Wrap_Struct (notmuch_rb_cQuery, NULL, NULL, query);\r
+ }\r
++\r
++/*\r
++ * call-seq: DB.get_all_tags() => TAGS\r
++ *\r
++ * Retrieve all tags in the database.\r
++ */\r
++VALUE\r
++notmuch_rb_database_get_all_tags (VALUE self)\r
++{\r
++ notmuch_database_t *db;\r
++ notmuch_tags_t *tags;\r
++\r
++ Data_Get_Notmuch_Database (self, db);\r
++\r
++ tags = notmuch_database_get_all_tags (db);\r
++ if (!tags)\r
++ rb_raise (notmuch_rb_eMemoryError, "Out of memory");\r
++\r
++ return Data_Wrap_Struct (notmuch_rb_cTags, NULL, NULL, tags);\r
++}\r
+diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+index fe81b3f..f1f7502 100644\r
+--- a/bindings/ruby/defs.h\r
++++ b/bindings/ruby/defs.h\r
+@@ -180,6 +180,9 @@ notmuch_rb_database_find_message_by_filename\r
+(VALUE self, VALUE pathv);\r
+ VALUE\r
+ notmuch_rb_database_query_create (VALUE self, VALUE qstrv);\r
+\r
++VALUE\r
++notmuch_rb_database_get_all_tags (VALUE self);\r
++\r
+ /* directory.c */\r
+ VALUE\r
+ notmuch_rb_directory_destroy (VALUE self);\r
+diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c\r
+index f4931d3..52561c7 100644\r
+--- a/bindings/ruby/init.c\r
++++ b/bindings/ruby/init.c\r
+@@ -230,6 +230,7 @@ Init_notmuch (void)\r
+ rb_define_method (notmuch_rb_cDatabase, "find_message_by_filename",\r
+ notmuch_rb_database_find_message_by_filename, 1); /* in database.c */\r
+ rb_define_method (notmuch_rb_cDatabase, "query",\r
+notmuch_rb_database_query_create, 1); /* in database.c */\r
++ rb_define_method (notmuch_rb_cDatabase, "all_tags",\r
+notmuch_rb_database_get_all_tags, 0); /* in database.c */\r
+\r
+ /*\r
+ * Document-class: Notmuch::Directory\r
+-- \r
+1.7.7.5 (Apple Git-26)\r
+\r
+--20cf307f334237a57404c4668b36\r
+Content-Type: text/html; charset=ISO-8859-1\r
+\r
+<pre style="word-wrap:break-word;white-space:pre-wrap">The python bindings define a binding for the all_tags method on the\r
+database, which is pretty handy. This commit adds the same binding to\r
+the ruby bindings.\r
+---\r
+ bindings/ruby/database.c | 20 ++++++++++++++++++++\r
+ bindings/ruby/defs.h | 3 +++\r
+ bindings/ruby/init.c | 1 +\r
+ 3 files changed, 24 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c\r
+index e84f726..d5ba108 100644\r
+--- a/bindings/ruby/database.c\r
++++ b/bindings/ruby/database.c\r
+@@ -395,3 +395,23 @@ notmuch_rb_database_query_create (VALUE self, VALUE qstrv)\r
+ \r
+ return Data_Wrap_Struct (notmuch_rb_cQuery, NULL, NULL, query);\r
+ }\r
++\r
++/*\r
++ * call-seq: DB.get_all_tags() => TAGS\r
++ *\r
++ * Retrieve all tags in the database.\r
++ */\r
++VALUE\r
++notmuch_rb_database_get_all_tags (VALUE self)\r
++{\r
++ notmuch_database_t *db;\r
++ notmuch_tags_t *tags;\r
++\r
++ Data_Get_Notmuch_Database (self, db);\r
++\r
++ tags = notmuch_database_get_all_tags (db);\r
++ if (!tags)\r
++ rb_raise (notmuch_rb_eMemoryError, "Out of memory");\r
++\r
++ return Data_Wrap_Struct (notmuch_rb_cTags, NULL, NULL, tags);\r
++}\r
+diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+index fe81b3f..f1f7502 100644\r
+--- a/bindings/ruby/defs.h\r
++++ b/bindings/ruby/defs.h\r
+@@ -180,6 +180,9 @@ notmuch_rb_database_find_message_by_filename (VALUE self, VALUE pathv);\r
+ VALUE\r
+ notmuch_rb_database_query_create (VALUE self, VALUE qstrv);\r
+ \r
++VALUE\r
++notmuch_rb_database_get_all_tags (VALUE self);\r
++\r
+ /* directory.c */\r
+ VALUE\r
+ notmuch_rb_directory_destroy (VALUE self);\r
+diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c\r
+index f4931d3..52561c7 100644\r
+--- a/bindings/ruby/init.c\r
++++ b/bindings/ruby/init.c\r
+@@ -230,6 +230,7 @@ Init_notmuch (void)\r
+ rb_define_method (notmuch_rb_cDatabase, "find_message_by_filename",\r
+ notmuch_rb_database_find_message_by_filename, 1); /* in database.c */\r
+ rb_define_method (notmuch_rb_cDatabase, "query", notmuch_rb_database_query_create, 1); /* in database.c */\r
++ rb_define_method (notmuch_rb_cDatabase, "all_tags", notmuch_rb_database_get_all_tags, 0); /* in database.c */\r
+ \r
+ /*\r
+ * Document-class: Notmuch::Directory\r
+-- \r
+1.7.7.5 (Apple Git-26)\r
+</pre><div><br></div>\r
+\r
+--20cf307f334237a57404c4668b36--\r