lib/redimap/config.rb in redimap-0.3.1 vs lib/redimap/config.rb in redimap-0.4.0

- old
+ new

@@ -2,10 +2,12 @@ module Redimap class Config + attr_accessor :log_level + attr_accessor :imap_host attr_accessor :imap_port attr_accessor :imap_username attr_accessor :imap_password @@ -16,29 +18,26 @@ attr_accessor :redis_ns_queue attr_accessor :polling_interval def initialize - @logger = Redimap.logger + @log_level = 'INFO' - @imap_host = ENV['IMAP_HOST'] - @imap_port = ENV['IMAP_PORT'] || 993 - @imap_username = ENV['IMAP_USERNAME'] - @imap_password = ENV['IMAP_PASSWORD'] + @imap_port = 993 - @imap_mailboxes = JSON.parse(ENV['IMAP_MAILBOXES'] || '["INBOX"]') + @imap_mailboxes = ['INBOX'] - @redis_url = ENV['REDIS_URL'] || "redis://127.0.0.1:6379/0" - @redis_ns_redimap = ENV['REDIS_NS_REDIMAP'] || "redimap" - @redis_ns_queue = ENV['REDIS_NS_QUEUE'] || "resque" + @redis_url = 'redis://127.0.0.1:6379/0' + @redis_ns_redimap = 'redimap' + @redis_ns_queue = 'resque' - @polling_interval = (ENV['POLLING_INTERVAL'] || 60).to_i - - @logger.debug { "Initialized #{to_s}" } + @polling_interval = 60 end def to_s { + :log_level => @log_level, + :imap_host => @imap_host, :imap_port => @imap_port, :imap_username => @imap_username, :imap_mailboxes => @imap_mailboxes,