lib/ryespy/config.rb in ryespy-0.6.1 vs lib/ryespy/config.rb in ryespy-0.7.0

- old
+ new

@@ -4,10 +4,11 @@ attr_accessor :log_level attr_accessor :listener attr_accessor :polling_interval attr_accessor :redis_url attr_accessor :redis_ns_ryespy + attr_accessor :redis_ns_notifiers attr_accessor :notifiers attr_accessor :imap_host attr_accessor :imap_port attr_accessor :imap_ssl @@ -20,14 +21,15 @@ attr_accessor :ftp_username attr_accessor :ftp_password attr_accessor :ftp_dirs def initialize - @log_level = 'INFO' - @polling_interval = 60 - @redis_ns_ryespy = 'ryespy:' - @notifiers = { + @log_level = 'INFO' + @polling_interval = 60 + @redis_ns_ryespy = 'ryespy:' + @redis_ns_notifiers = 'resque:' + @notifiers = { :sidekiq => [], } @imap_port = 993 @imap_ssl = true @@ -42,23 +44,24 @@ :log_level, :listener, :polling_interval, :redis_url, :redis_ns_ryespy, + :redis_ns_notifiers, :notifiers, ] - params.concat case @listener - when :imap + params.concat case @listener.to_s + when 'imap' [ :imap_host, :imap_port, :imap_ssl, :imap_username, :imap_password, ] - when :ftp + when 'ftp' [ :ftp_host, :ftp_passive, :ftp_username, :ftp_dirs, @@ -68,9 +71,13 @@ end params.collect! { |s| [s, instance_variable_get("@#{s}")] } Hash[params].to_s + end + + def redis_prefix_ryespy + "#{Ryespy.config.redis_ns_ryespy}#{Ryespy.config.listener}:" end end end