Module: AutotestNotification

Defined in:
lib/autotest_notification/version.rb,
lib/autotest_notification.rb,
lib/autotest_notification/mac.rb,
lib/autotest_notification/linux.rb,
lib/autotest_notification/cygwin.rb,
lib/autotest_notification/windows.rb

Overview

:nodoc:

Defined Under Namespace

Modules: VERSION Classes: Cygwin, Linux, Mac, Windows

Constant Summary collapse

FAIL =
-1
PENDING =
0
SUCCESS =
1
EXPIRATION_IN_SECONDS =
3
IMAGES_DIRECTORY =
File.expand_path(File.dirname(__FILE__) + "/../images/")
SUCCESS_IMAGE =
"#{IMAGES_DIRECTORY}/pass.png"
FAIL_IMAGE =
"#{IMAGES_DIRECTORY}/fail.png"

Class Method Summary collapse

Class Method Details

.notify(title, msg, img = SUCCESS_IMAGE, pri = 0) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/autotest_notification.rb', line 56

def notify(title, msg, img = SUCCESS_IMAGE, pri = 0)
  case RUBY_PLATFORM
  when /linux/
    Linux.notify(title, msg, img)
  when /darwin/
    Mac.notify(title, msg, img, pri)
  when /cygwin/
    Cygwin.notify(title, msg, img)
  when /mswin/
    Windows.notify(title, msg, img)
  end
end

.pluralize(text, number) ⇒ Object



69
70
71
# File 'lib/autotest_notification.rb', line 69

def pluralize(text, number)
  "#{number} #{text}#{'s' if number != 1}"
end