Sha256: 2f9d81e501ec5dd9a8f351580817831f78fa13e7fb55d169b9d9205a3a9eaf53
Contents?: true
Size: 831 Bytes
Versions: 13
Compression:
Stored size: 831 Bytes
Contents
module AutotestNotification class Doom class << self def image(total, failures) "#{Config.images_directory}/doom/doom_#{percent(total, failures)}.png" end def play_sound(total, failures) sound_file = "#{File.expand_path(File.dirname(__FILE__) + "/../../sounds/doom/")}/#{percent(total, failures)}.wav" case RUBY_PLATFORM when /darwin/ `#{File.expand_path(File.dirname(__FILE__) + "/../../bin/")}/playsound #{sound_file}` when /linux/ system("/usr/bin/mplayer #{sound_file} > /dev/null 2> /dev/null") when /cygwin/ system "cp #{sound_file} /dev/dsp" end end private def percent(total, failures) percent = failures.zero? ? 0 : ((5 * failures) / total) + 1 end end end end
Version data entries
13 entries across 13 versions & 4 rubygems