[PATCH v2 3/3] ruby: make db.config return an enumerator

2021-06-29 Thread Felipe Contreras
Currently db.config requires a block to work: db.config { |k, v| puts '%s=%s' % [k, v] } If you try to use it without a block you, get an error like: in `config': no block given (LocalJumpError) In Ruby most methods should return an Enumerator if no block is given, like: (1..10).each

[PATCH v2 2/3] ruby: add db.config

2021-06-29 Thread Felipe Contreras
In order to use notmuch_config_get_pairs. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 31 +++ bindings/ruby/defs.h | 4 bindings/ruby/init.c | 1 + test/T395-ruby.sh| 8 4 files changed, 44 insertions(+) diff --git

[PATCH v2 1/3] ruby: add new Database.open_with_config

2021-06-29 Thread Felipe Contreras
In order to make use of notmuch_database_open_with_config. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 62 bindings/ruby/defs.h | 6 bindings/ruby/init.c | 1 + test/T395-ruby.sh| 6 4 files changed, 75

[PATCH v2 0/3] ruby: add latest config API

2021-06-29 Thread Felipe Contreras
Currently the simplest way to open the notmuch database properly a client must do: $config = IO.popen(%w[notmuch config list]) do |io| io.each(chomp: true).map { |e| e.split('=') }.to_h end $db_name = config['database.path'] $db = Notmuch::Database.new($db_name) While this works and

Re: [PATCH] test: deduplicate T590

2021-06-29 Thread David Bremner
Michael J Gruber writes: > Test numbers are a concise way to communicate about tests and to remeber > them. Currently, there is one pait of duplicates: > > T590-libconfig.sh > T590-thread-breakage.sh > > Renumber the latter one to 592 since this keeps the alphabetic order and > leaves room in

[PATCH] test: deduplicate T590

2021-06-29 Thread Michael J Gruber
Test numbers are a concise way to communicate about tests and to remeber them. Currently, there is one pait of duplicates: T590-libconfig.sh T590-thread-breakage.sh Renumber the latter one to 592 since this keeps the alphabetic order and leaves room in between. Signed-off-by: Michael J Gruber

Re: [PATCH] devel: two scripts for checking proposed changes

2021-06-29 Thread David Bremner
Tomi Ollila writes: >> + >> +set -e >> +make test > > This may fail miserably (or is painfully slow (doing configure and make...) > At least for my use case, running the tests for each commit is the main point. The formatting stuff is nice to have, but only if the tests run. I could invoke the