aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/server.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-17 11:08:07 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-17 11:08:07 +0100
commit8c8e5ae926e0009743fe92dccb588783640a6022 (patch)
treee23eea583beac0caf5fb3e45a33b4d2ac7796abf /lib/mauve/server.rb
parent79dcf16ec6d229d6c31e055ed8e6a98327526a3a (diff)
* Reminder notifications now take the same path to notify as initial alerts
* Threading tidied -- processor will not do anything unless the timer has frozen * Person#send_alert now tidied and merged with alert_changed * POP3 server only shows alerts relevant to the user * Server now defaults to using an in-memory SQLite database (good for testing) * Server initializes a blank mauve config. * Tests tidied up
Diffstat (limited to 'lib/mauve/server.rb')
-rw-r--r--lib/mauve/server.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/mauve/server.rb b/lib/mauve/server.rb
index 5cc8484..27157a5 100644
--- a/lib/mauve/server.rb
+++ b/lib/mauve/server.rb
@@ -32,7 +32,7 @@ module Mauve
def initialize
super
@hostname = "localhost"
- @database = "sqlite3:///./mauvealert.db"
+ @database = "sqlite3::memory:"
@started_at = Time.now
@initial_sleep = 300
@@ -65,6 +65,12 @@ module Mauve
end
def setup
+ #
+ #
+ #
+ @packet_buffer = []
+ @notification_buffer = []
+
DataMapper.setup(:default, @database)
# DataObjects::Sqlite3.logger = Log4r::Logger.new("Mauve::DataMapper")
@@ -75,6 +81,10 @@ module Mauve
AlertChanged.auto_upgrade!
History.auto_upgrade!
Mauve::AlertEarliestDate.create_view!
+
+ Mauve::Configuration.current = Mauve::Configuration.new if Mauve::Configuration.current.nil?
+
+ return nil
end
def start