Sha256: 488afc2ed665e40b138598db17357299fd57e2dbbf1335bcae693d901b4b8468

Contents?: true

Size: 555 Bytes

Versions: 1

Compression:

Stored size: 555 Bytes

Contents

module AutotestNotification
  class Doom
    class << self
      def image(total, failures)
        "#{IMAGES_DIRECTORY}/doom/doom_#{percent(total, failures)}.png"
      end

      def play_sound(total, failures)
        `#{File.expand_path(File.dirname(__FILE__) + "/../../bin/")}/playsound #{File.expand_path(File.dirname(__FILE__) + "/../../sounds/doom/")}/#{percent(total, failures)}.wav`
      end

      private
        def percent(total, failures)
          percent = failures.zero? ? 0 : ((5 * failures) / total) + 1
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
carlosbrando-autotest-notification-1.3.0 lib/autotest_notification/doom.rb