diff options
| author | David Bremner <david@tethera.net> | 2016-11-02 08:09:24 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2016-11-02 08:09:24 -0300 |
| commit | 39b6080f590d4dad29c4fb941258085c30d9fe01 (patch) | |
| tree | c60ee73e341509783ecb018c873d29a3e1ba0a08 /bindings/ruby | |
| parent | 79b3ba1b80fe20572144d1afd754f7c48d12d86e (diff) | |
| parent | ad517e9195a29b26955999c6e11fc37c73dbc01e (diff) | |
Merge tag 'debian/0.23.1-1' into jessie-backports
notmuch Debian 0.23.1-1 upload (same as 0.23.1)
Diffstat (limited to 'bindings/ruby')
| -rw-r--r-- | bindings/ruby/database.c | 26 | ||||
| -rw-r--r-- | bindings/ruby/defs.h | 5 | ||||
| -rw-r--r-- | bindings/ruby/directory.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/filenames.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/init.c | 3 | ||||
| -rw-r--r-- | bindings/ruby/message.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/messages.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/query.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/status.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/tags.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/thread.c | 2 | ||||
| -rw-r--r-- | bindings/ruby/threads.c | 2 |
12 files changed, 40 insertions, 12 deletions
diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index c03d7011..12e6bab7 100644 --- a/bindings/ruby/database.c +++ b/bindings/ruby/database.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ @@ -375,6 +375,30 @@ notmuch_rb_database_find_message_by_filename (VALUE self, VALUE pathv) } /* + * call-seq: DB.get_all_tags() => TAGS + * + * Returns a list of all tags found in the database. + */ +VALUE +notmuch_rb_database_get_all_tags (VALUE self) +{ + notmuch_database_t *db; + notmuch_tags_t *tags; + + Data_Get_Notmuch_Database (self, db); + + tags = notmuch_database_get_all_tags (db); + if (!tags) { + const char *msg = notmuch_database_status_string (db); + if (!msg) + msg = "Unknown notmuch error"; + + rb_raise (notmuch_rb_eBaseError, "%s", msg); + } + return Data_Wrap_Struct (notmuch_rb_cTags, NULL, NULL, tags); +} + +/* * call-seq: DB.query(query) => QUERY * * Retrieve a query object for the query string 'query' diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index f4901a04..48544ca2 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ @@ -178,6 +178,9 @@ VALUE notmuch_rb_database_find_message_by_filename (VALUE self, VALUE pathv); VALUE +notmuch_rb_database_get_all_tags (VALUE self); + +VALUE notmuch_rb_database_query_create (VALUE self, VALUE qstrv); /* directory.c */ diff --git a/bindings/ruby/directory.c b/bindings/ruby/directory.c index 303523c2..0f37b391 100644 --- a/bindings/ruby/directory.c +++ b/bindings/ruby/directory.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/filenames.c b/bindings/ruby/filenames.c index e2785903..656c58e6 100644 --- a/bindings/ruby/filenames.c +++ b/bindings/ruby/filenames.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c index ab3f22df..5556b43e 100644 --- a/bindings/ruby/init.c +++ b/bindings/ruby/init.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ @@ -229,6 +229,7 @@ Init_notmuch (void) notmuch_rb_database_find_message, 1); /* in database.c */ rb_define_method (notmuch_rb_cDatabase, "find_message_by_filename", notmuch_rb_database_find_message_by_filename, 1); /* in database.c */ + rb_define_method (notmuch_rb_cDatabase, "all_tags", notmuch_rb_database_get_all_tags, 0); /* in database.c */ rb_define_method (notmuch_rb_cDatabase, "query", notmuch_rb_database_query_create, 1); /* in database.c */ /* diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c index 4ff6097f..c55cf6e2 100644 --- a/bindings/ruby/message.c +++ b/bindings/ruby/message.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/messages.c b/bindings/ruby/messages.c index 443a30c9..a337feeb 100644 --- a/bindings/ruby/messages.c +++ b/bindings/ruby/messages.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c index 8cbc73f2..ce66926c 100644 --- a/bindings/ruby/query.c +++ b/bindings/ruby/query.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/status.c b/bindings/ruby/status.c index b11fb9fb..a0f88633 100644 --- a/bindings/ruby/status.c +++ b/bindings/ruby/status.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/tags.c b/bindings/ruby/tags.c index e8226ad7..db8b4cfc 100644 --- a/bindings/ruby/tags.c +++ b/bindings/ruby/tags.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/thread.c b/bindings/ruby/thread.c index 56616d9f..9b295981 100644 --- a/bindings/ruby/thread.c +++ b/bindings/ruby/thread.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ diff --git a/bindings/ruby/threads.c b/bindings/ruby/threads.c index 3e1fbf5d..ed403a8f 100644 --- a/bindings/ruby/threads.c +++ b/bindings/ruby/threads.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel <alip@exherbo.org> */ |
