Class: CheckZilla::Notifier::NotifySend
- Inherits:
-
Object
- Object
- CheckZilla::Notifier::NotifySend
- Defined in:
- lib/checkzilla/notifier/notify_send.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ NotifySend
constructor
A new instance of NotifySend.
- #perform!(checkers) ⇒ Object
Constructor Details
#initialize(&block) ⇒ NotifySend
Returns a new instance of NotifySend.
5 6 7 |
# File 'lib/checkzilla/notifier/notify_send.rb', line 5 def initialize &block self end |
Instance Method Details
#perform!(checkers) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/checkzilla/notifier/notify_send.rb', line 9 def perform! checkers checkers.each do |checker| checker_name = checker.class.name.split("::").last title = "CheckZilla: #{checker_name}" body = [] checker.results.each do |name, versions| local_version = versions[0] newer_version = versions[1] body << "#{name} (#{local_version} -> #{newer_version})" end `notify-send -u normal "#{title}" "#{body.join(', ')}"` if body.size > 0 end end |