Sha256: f6186bc3a72a3c6152630e1948e555c4d3614161bdea447c04db0f9e56c15a52
Contents?: true
Size: 891 Bytes
Versions: 22
Compression:
Stored size: 891 Bytes
Contents
class LibnotifyIO attr_reader :io, :libnotify def initialize io @io = io @libnotify = begin require 'libnotify' Libnotify.new(:timeout => 2.5, :append => false) end end def puts *o if o.first =~ /(\d+) failures, (\d+) errors/ description = [ RUBY_ENGINE, RUBY_VERSION, RUBY_PLATFORM ].join(" ") libnotify.body = o.first if $1.to_i > 0 || $2.to_i > 0 # fail? libnotify.summary = ":-( #{description}" libnotify.urgency = :critical libnotify.icon_path = "face-angry.*" else libnotify.summary += ":-) #{description}" libnotify.urgency = :normal libnotify.icon_path = "face-laugh.*" end libnotify.show! else io.puts *o end end def method_missing msg, *args io.send(msg, *args) end end MiniTest::Unit.output = LibnotifyIO.new(MiniTest::Unit.output)
Version data entries
22 entries across 22 versions & 1 rubygems