mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-23 03:18:08 +01:00
ruby: database: make path arg optional
It can be automatically loaded from the configuration now. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
parent
83ea220178
commit
4152e1bc20
2 changed files with 8 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue