class Test::Unit::Notify::Growlnotify

@private

Public Class Methods

new() click to toggle source
# File lib/test/unit/notify.rb, line 127
def initialize
  @command = "growlnotify"
end

Public Instance Methods

run(parameters) click to toggle source
# File lib/test/unit/notify.rb, line 131
def run(parameters)
  priority = urgency_to_piroity(parameters[:urgency])
  title = parameters[:title]
  message = parameters[:message]
  image = parameters[:icon]

  command_line = [
    @command,
    "--priority", priority,
    "--message", message,
  ]
  command_line.concat(["--image", image.to_s]) if image
  command_line << title
  system(*command_line)
end

Private Instance Methods

urgency_to_piroity(urgency) click to toggle source
# File lib/test/unit/notify.rb, line 148
def urgency_to_piroity(urgency)
  case urgency
  when "normal"
    "Normal"
  when "critical"
    "Emergency"
  else
    "Normal"
  end
end