bin/ryespy in ryespy-0.6.1 vs bin/ryespy in ryespy-0.7.0
- old
+ new
@@ -46,10 +46,14 @@
opts.on("--redis-ns-ryespy [NS]", "Namespace Redis 'ryespy:' as NS") do |o|
options[:redis_ns_ryespy] = o
end
+ opts.on("--redis-ns-notifiers [NS]", "Namespace notifiers Redis 'resque:' as NS") do |o|
+ options[:redis_ns_notifiers] = o
+ end
+
opts.separator ""
opts.separator "Listener imap:"
opts.on("--imap-host HOST", "Connect IMAP with HOST") do |o|
options[:imap_host] = o
@@ -141,24 +145,25 @@
params = [
:polling_interval,
:redis_url,
:redis_ns_ryespy,
+ :redis_ns_notifiers,
:notifiers,
]
- params.concat case c.listener
- when :imap
+ params.concat case c.listener.to_s
+ when 'imap'
[
:imap_host,
:imap_port,
:imap_ssl,
:imap_username,
:imap_password,
:imap_mailboxes,
]
- when :ftp
+ when 'ftp'
[
:ftp_host,
:ftp_passive,
:ftp_username,
:ftp_password,
@@ -175,10 +180,15 @@
# = Main loop
loop do
- Ryespy.check_listener
+ listener = {
+ 'imap' => Ryespy::Listener::IMAP,
+ 'ftp' => Ryespy::Listener::FTP,
+ }[Ryespy.config.listener.to_s].new
+
+ listener.check_all
break unless options[:eternal]
@logger.debug { "Snoring for #{Ryespy.config.polling_interval} s" }