From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6AdkCy0Nq2AWRAAAgWs5BA (envelope-from ) for ; Mon, 24 May 2021 04:19:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mOQNBy0Nq2DYJwAAB5/wlQ (envelope-from ) for ; Mon, 24 May 2021 02:19:25 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8FAAB14B1E for ; Mon, 24 May 2021 04:19:24 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3A9A52AB1F; Sun, 23 May 2021 22:19:17 -0400 (EDT) Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by mail.notmuchmail.org (Postfix) with ESMTPS id D87D32AB1A for ; Sun, 23 May 2021 22:19:13 -0400 (EDT) Received: by mail-oo1-xc36.google.com with SMTP id v13-20020a4aa40d0000b02902052145a469so5996105ool.3 for ; Sun, 23 May 2021 19:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8hYRE76yxmcFNfOA0z25xO5+T4jWtfKd67p/tMy7t8g=; b=kM8AzH0cav7LxqhDgqn3qKelk98HejRiGmrOR/UJHUwtkV/VQp1nDDi7/doRucVPZ3 uY7lMiPPTNnSH9L7NUqDL8DDOsx1jSQq6eOTWdqx6xzZ+yf06FJfnAgZu6hTJDcRU/Hq BN4UakNsGIZwHy8H6OpCp5jVXpxFucpTQb6ZUY/0nEbLF4Rmm5PmHfUtNO6QRxomSbJv PRA/oNMj5Ya4uxeOe522dPiuyo8aDR8diP4NnxmEzll39gRkveT5tv4Qgrw3bK370mhd EFnW75TJz9BumXLPBY3NayZrQuZG6y+NQjLI646BdiOhWZoauseRt9zqX7SyX8aud5mr 5XOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8hYRE76yxmcFNfOA0z25xO5+T4jWtfKd67p/tMy7t8g=; b=SRbQxtZLu1vpqooBz7yscSesbs279s0SJKAXBivzAoxp8JRCX5xkKnDImYYrDBTM4i erX5OSExTa7PFady6KriMssZ5HaY0AHsbK4oGqUMk5BeX2UcRwdsEuoBjbTU5lfK+0zn 4DdqVD/Vqq1qfnBBXIH4msHoc9HTbIZMwLTTCAoFYbzBhDN+7gphsnc3VPLyUer9TDUD H+fJPtO9CbWKwN0D0ra7cMcYtUqlmp5ehvsbKoUVccTtR4KN7Ppd5KTJyS56n+7GU+wd Jzdm0SWVr5c9/SW8MxOgyqvE53Pd5/wmgFUKbbjWTfENZ+ZqaWEAeqJwkHOFe8VKU/rg swEQ== X-Gm-Message-State: AOAM531zB1H6xN0zcscBAHyvv0KuTow1eU2vYjOlwealrvelJnRH1ktS HlhRkdxWEb3KKwHt1wlnlQSK3O7U6x3r8Q== X-Google-Smtp-Source: ABdhPJx4y3EiRQ9/7acpaKvK5eOlscfVydJFhTsoC45vJ2UOmqyQ6z+Ne4CCebb4Y1LJ8YMB4BA0Gw== X-Received: by 2002:a4a:49c8:: with SMTP id z191mr16209044ooa.62.1621822752772; Sun, 23 May 2021 19:19:12 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id d19sm2574467oop.26.2021.05.23.19.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 19:19:12 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH v2 0/2] ruby: improve db.query Date: Sun, 23 May 2021 21:19:08 -0500 Message-Id: <20210524021910.92145-1-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 MIME-Version: 1.0 Message-ID-Hash: MJRSGKXDOAPSTC6PCOUWKEV2GIZHADHH X-Message-ID-Hash: MJRSGKXDOAPSTC6PCOUWKEV2GIZHADHH X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Ludovic LANGE , Stefano Zacchiroli X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621822764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=y1yjOYkjK1oJW56yQ5nqVwSQdZTAX4sYC4/stHaF9is=; b=dLY6GZbhN8dExUDj8L8B7Ip4cd5EzFILY0VVrz10xkXgLV6EtveCKmCqK2BG+AE/vIEVnS aVbvG6yobMWGJiw7NwiLQwSoKwegpNGyvHiaBNfmJN/POi4YtQCpQkWT85BVPuypc3a5ef ezJoyCKKsFRFomL576HLgCrztwdjlH5d5rC0PnUFL3u9ga1K6pG2d4jFUJ9vnBlk6MUfhh 5H7jZNR4Tk6FVHDDdzKKpDc66bQGCsrvcmwtlYCRKL0TaJ7GYr+tiuUOtPC76HyyvmpMZ2 qgutYdJJaxeeRCA1OzWdX0w+P3zAc2g2xeWqk/6ANq4dxScbewbmCFKmMCxdwA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621822764; a=rsa-sha256; cv=none; b=gw07wPFqG7S04ld72E081/DUcErMmQ7WYMGIBxtt2+nBfQiS5Fm3EAcaXEcNbTIDPnhTXE wSzrcRsdGD7e4hdzVvVGdJquGuB+q6RfxidmX+UeQm16XibkT2B9l6iQhjm977/ciiU6CG K8pU/alB0I2K+RlQahW5dXk5s3YXX1gpkmNQ3Ch2sS9hAcpsbETvZjgJUA+ytkX3SyWqJl DYxV9si7oiofVymg0n1mqmd6SNWWKQHQphlDDYjbpbqntVxo8949TtEPj5NyNHmz1qt1ja 1ndZM9+8PyqPhylq7vtehw2+o9xtIHb/jTV7OM9SUamy4ebF9g5iy85NEJfbxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=kM8AzH0c; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.97 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=kM8AzH0c; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 8FAAB14B1E X-Spam-Score: -0.97 X-Migadu-Scanner: scn0.migadu.com X-TUID: RnX0+WMeCl/Q I find it a bit annoying to have to modify the query object to add options when Notmuch::Database.query() can do that just fine. This series also adds a mapping to the notmuch_exclude_t enum in order to be able to specify NOTMUCH_EXCLUDE_ALL and others. Nothing changed from v1 except rebased on master of May 23. Felipe Contreras (2): ruby: add keyword arguments to db.query test: ruby: simplify basic tests bindings/ruby/database.c | 47 +++++++++++++++++++++++++++++++++++++--- bindings/ruby/defs.h | 2 +- bindings/ruby/init.c | 2 +- test/T395-ruby.sh | 30 ++++++++++++++++++------- 4 files changed, 68 insertions(+), 13 deletions(-) Range-diff against v1: 1: 8cc8cedd < -: -------- ruby: use notmuch_exclude_t enum 2: 70938802 ! 1: ec8b5d1a ruby: add keyword arguments to db.query @@ bindings/ruby/database.c: notmuch_rb_database_query_create (VALUE self, VALUE qs + } + } + - return Data_Wrap_Struct (notmuch_rb_cQuery, NULL, NULL, query); + return Data_Wrap_Notmuch_Object (notmuch_rb_cQuery, ¬much_rb_query_type, query); } ## bindings/ruby/defs.h ## 3: 26519f68 = 2: 29c15ec1 test: ruby: simplify basic tests -- 2.32.0.rc0