mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-23 11:28:13 +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;
|
notmuch_status_t ret;
|
||||||
|
|
||||||
/* Check arguments */
|
/* Check arguments */
|
||||||
rb_scan_args (argc, argv, "11", &pathv, &hashv);
|
rb_scan_args (argc, argv, "02", &pathv, &hashv);
|
||||||
|
|
||||||
|
if (!NIL_P (pathv)) {
|
||||||
SafeStringValue (pathv);
|
SafeStringValue (pathv);
|
||||||
path = RSTRING_PTR (pathv);
|
path = RSTRING_PTR (pathv);
|
||||||
|
} else {
|
||||||
|
path = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!NIL_P (hashv)) {
|
if (!NIL_P (hashv)) {
|
||||||
Check_Type (hashv, T_HASH);
|
Check_Type (hashv, T_HASH);
|
||||||
|
|
|
@ -12,7 +12,7 @@ test_ruby() {
|
||||||
(
|
(
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
require 'notmuch'
|
require 'notmuch'
|
||||||
db = Notmuch::Database.new('$MAIL_DIR')
|
db = Notmuch::Database.new()
|
||||||
EOF
|
EOF
|
||||||
cat
|
cat
|
||||||
) | $NOTMUCH_RUBY -I "$NOTMUCH_BUILDDIR/bindings/ruby"> OUTPUT
|
) | $NOTMUCH_RUBY -I "$NOTMUCH_BUILDDIR/bindings/ruby"> OUTPUT
|
||||||
|
|
Loading…
Reference in a new issue