aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2023-03-22 20:05:23 -0600
committerDavid Bremner <david@tethera.net>2023-03-31 07:56:03 -0300
commit4152e1bc20fa2803186740c76579b495f4c77fb6 (patch)
tree6a9af6a4ef7d588e6fe5b9ccb683d37f43fb7f10 /bindings
parent83ea220178f771bf5a4f6e2f4fe3a3dd2e96676e (diff)
ruby: database: make path arg optional
It can be automatically loaded from the configuration now. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/ruby/database.c10
1 files changed, 7 insertions, 3 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);