diff options
author | mms <git@sapka.me> | 2024-11-14 22:34:47 +0100 |
---|---|---|
committer | mms <git@sapka.me> | 2024-11-14 22:34:57 +0100 |
commit | 8c084e0faa971e6db265ea39aefb8cf07e39de43 (patch) | |
tree | 899e4f6f8e7e33ab01d09ad917c86fd32944a4bb /lib/chotto.rb | |
parent | 4d87cb470b2c306c126d2d739d50577702374926 (diff) |
chore: add specs for all classes
Diffstat (limited to 'lib/chotto.rb')
-rw-r--r-- | lib/chotto.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/chotto.rb b/lib/chotto.rb index 6e1f908..71a1ac8 100644 --- a/lib/chotto.rb +++ b/lib/chotto.rb @@ -9,7 +9,6 @@ require_relative 'chotto/helpers' require_relative 'chotto/message' require_relative 'chotto/messages' require_relative 'chotto/ruleset' -require_relative 'chotto/tags' module Chotto class << self @@ -18,15 +17,16 @@ module Chotto def configure(&block) @config ||= Config.new + @config.db_class = ::Notmuch::Database @rule_sets = [] instance_eval(&block) - @db = Database.new(path: config.database_path) + @db = Database.new(path: config.database_path, db_class: config.db_class) end def rule_set(name, &block) - @rule_sets << RuleSet.new(name, block) + @rule_sets << RuleSet.new(name, db, block) end def close_db @@ -36,8 +36,6 @@ module Chotto end def eval_rules - Chotto.rule_sets.each do |rule_set| - rule_set.run - end + Chotto.rule_sets.each(&:run) Chotto.close_db end |