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/database.c | |
| 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/database.c')
| -rw-r--r-- | bindings/ruby/database.c | 26 |
1 files changed, 25 insertions, 1 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' |
