From 8c084e0faa971e6db265ea39aefb8cf07e39de43 Mon Sep 17 00:00:00 2001 From: mms Date: Thu, 14 Nov 2024 22:34:47 +0100 Subject: chore: add specs for all classes --- lib/chotto.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/chotto.rb') 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 -- cgit v1.2.3