8 DEFAULT_PATH = File.expand_path('../../../var/reminders.yaml', __FILE__)
13 ENV['NOS_OIGNONS_REMINDER_DB'] || DEFAULT_PATH
21 # hash of email => last_reminder_date
23 @reminders = YAML.load_file(db_path)
30 # save using atomic rename
31 file = Tempfile.new('reminder_db', File.dirname(db_path))
33 file.write(YAML.dump(@reminders))
35 File.rename file.path, db_path
42 def last_reminder(member)
43 @reminders[member.email]
47 @reminders[member.email] = Time.now.to_date
48 # Not efficient, but let's put people's mailbox as first priority