From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id zt+8NfWzG2SeHAAASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 03:05:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EDHqM/WzG2QwegAAG6o9tA (envelope-from ) for ; Thu, 23 Mar 2023 03:05:41 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 9F8BF29FD3 for ; Thu, 23 Mar 2023 03:05:41 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CF9675F822; Thu, 23 Mar 2023 02:05:33 +0000 (UTC) Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) by mail.notmuchmail.org (Postfix) with ESMTPS id C27D65F7F0 for ; Thu, 23 Mar 2023 02:05:30 +0000 (UTC) Received: by mail-oo1-xc34.google.com with SMTP id o15-20020a4ae58f000000b00538c0ec9567so2836582oov.1 for ; Wed, 22 Mar 2023 19:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679537129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SagSH1lycpbDEUhuzrBgn1dZhDGynwu5EZUDfQDFNjI=; b=VNjqTveofx24sUe92T18vpOIJQePHy0YVQFJaSWTP/CKu/Wj0tUoYaD8FUIGangv2P bPNhv4H5VTuN/kcukds112Rd3724/EVHk3M/S8l5ujMHwU/GgA6AehsXXh98nhHrL6YQ Qw07fgl53hwJbmggEtJjR1l64zvT0RLTg4rWdtGc8Me39s2zjdmKtyhFXTyWFxwfHbJC mAJ/IB/pLHI1l09gxl5hQyMqgwHdktNQbLoYeQ8K0NWUrNm0Dogdy/2Q81FVT5SSjLoA HU1NXE7hakTOz8bLiLuFjKoouFyw7EKkbEglBvrj6IJJqXa7oMY7S8k26F6+vpaQeHIP aKuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679537129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SagSH1lycpbDEUhuzrBgn1dZhDGynwu5EZUDfQDFNjI=; b=W7kmXJI3HX0dccPUBZCuXInjsBzDQHrklbnEnpjprLUHr5o/S8IrQJE/II1Ov6+vCc h0b9bAewyLTE1VnnYBe25CQdJhd4HeCxv8NwfvthJCFFioIlRgRnpqc2aNJmNyvBIAh7 KL7FaKDsFEQEgVJx4dP5ZNDt2GOgU191KN6YgabzCxqbptk0LxWQzr2LDcz5Ar0gtZcS YwEgMZaMq4ihx4ThuIeqyjv7q4j3qHG2hDmkuWNXyJ5Q7qYWscxXgfSZKe/70yp4h+ey m4tCnpzqJpxUc4tH/EcGVeA9ACZDjZ/uNULn/XiFsXlMc4GxcJkHrNhu+YeHA9DKiJDT TfUQ== X-Gm-Message-State: AO0yUKVRwxVQM2k7GSsKmLqoo/UZ2Xc0XR+gzvNwsGWZXESbgGynNEUw amH39IRC0oHS2V3iPYcVUNsI2GF4FvM= X-Google-Smtp-Source: AK7set/wQtHybvGMGmGyjBPIlcemkThgsgU2YwlnmhdxSM1gh2zTfakvzDuobaeWyPEwS20CBN/V9Q== X-Received: by 2002:a4a:33d8:0:b0:525:4e79:8715 with SMTP id q207-20020a4a33d8000000b005254e798715mr533773ooq.8.1679537129193; Wed, 22 Mar 2023 19:05:29 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id z14-20020a54458e000000b0037b6f5d6309sm36676oib.2.2023.03.22.19.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 19:05:28 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 2/2] ruby: database: make path arg optional Date: Wed, 22 Mar 2023 20:05:23 -0600 Message-Id: <20230323020523.135299-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230323020523.135299-1-felipe.contreras@gmail.com> References: <20230323020523.135299-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: JCG3QH4GULUYKPVADYTOXUVE6Q2FR4MW X-Message-ID-Hash: JCG3QH4GULUYKPVADYTOXUVE6Q2FR4MW 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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679537141; a=rsa-sha256; cv=none; b=JSQj9Cca6FCSpHwTZBbbloP3huv4gDpsH027UbJBMlKEg0DWA92NTOSTfRSGGvvX3+KvjW kF1IMLm/d8Xe3dYtZqAwOM4G3jT+L1h93SFacFyBEIQty1YJyv6xj8pR5JQ7DMMsJwQ3s7 94mj4Ef331QzrrsEfwcLaNs+rNxqJtPjQA+h83hgJMSvrTDRB+Xxy/ZdRPtzRGq/sIuAGR I0X0h90eYuI9/WTkWpN5akXwBE73p/nLUz23ODE3UCxOcINMdyAunNTFaCDPUSUihQtroC Xi/3E1e7J+MeGeompVaVXZOVq+1rhA1g55SZDTQ8iWiKqqOGRfDS5qYkvgF/WA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=VNjqTveo; 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 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679537141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=bRoI/4gJBAkVtLD21LkAwCkn9kq2lUdc11r+TjmV1N4=; b=X0non+60mifT/4xU/57d61NZ6kPof6Lsy/tC2qKhP/enGYXaBzDTSI2dB6qFbffw30TOKB q/dXP2I98af8Rz6/zd5X72JE9IG9SUC9TnC1aBenBsQMyZqA+q5hUOQeMWPaBXPzp9hsih 6volfRKT7cBj7re5QLAeJA5gX8ItOhj9NLjviOgO2DfdzhSwHXimOz1/t9STKdRDG5nvFZ Qp3Sn7fMWjn6KGdCJuSB0E79Tujl3LD9ouH1nQLVf16O5dLFsp1aG4rghw/+oZEejpIshA nnKZ707H6scetk7YmsEwibRwL0zlSHc4r3ZO/OkTS/OxEBJ5/Ib2VsDT0uAL9w== Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=VNjqTveo; 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 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.55 X-Spam-Score: -0.55 X-Migadu-Queue-Id: 9F8BF29FD3 X-TUID: 9hC0iJ6uBFPX It can be automatically loaded from the configuration now. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 10 +++++++--- test/T395-ruby.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index a78d508b..b6de1254 100644 --- a/bindings/ruby/database.c +++ b/bindings/ruby/database.c @@ -59,10 +59,14 @@ notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self) notmuch_status_t ret; /* Check arguments */ - rb_scan_args (argc, argv, "11", &pathv, &hashv); + rb_scan_args (argc, argv, "02", &pathv, &hashv); - SafeStringValue (pathv); - path = RSTRING_PTR (pathv); + if (!NIL_P (pathv)) { + SafeStringValue (pathv); + path = RSTRING_PTR (pathv); + } else { + path = NULL; + } if (!NIL_P (hashv)) { Check_Type (hashv, T_HASH); diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index e828efed..c066c842 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -12,7 +12,7 @@ test_ruby() { ( cat <<-EOF require 'notmuch' - db = Notmuch::Database.new('$MAIL_DIR') + db = Notmuch::Database.new() EOF cat ) | $NOTMUCH_RUBY -I "$NOTMUCH_BUILDDIR/bindings/ruby"> OUTPUT -- 2.39.2.13.g1fb56cf030