Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module KNotify
- def self.notify(title, msg, colour)
- system 'dcop knotify default notify eventname ' +
- "'<span style=\"font-weight: bold; color: #{colour}\">#{title}</span>' " +
- "'<span style=\"color: #{colour}\">#{msg}</span>' '' '' 16 2"
- end
- Autotest.add_hook(:initialize) do |autotest|
- %w{ .svn .hg .git vendor }.each { |exception| autotest.add_exception(exception) }
- end
- Autotest.add_hook(:ran_command) do |autotest|
- if autotest.results.split("\n").last.first =~ /([0-9]+\sexamples,\s([0-9]+)\sfailures?(,\s([0-9]+) pending)?)/
- notify(*case
- when $2.to_i > 0: ['FAILED', $1, 'darkred']
- when $4.to_i > 0: ['PASSED', $1, 'goldenrod']
- else ['PASSED', $1, 'darkgreen']
- end)
- end
- end
- end
Add Comment
Please, Sign In to add comment