Class: GrowlOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/outputs/growl_output.rb

Instance Method Summary collapse

Constructor Details

#initialize(growler) ⇒ GrowlOutput


3
4
5
# File 'lib/outputs/growl_output.rb', line 3

def initialize(growler)
  @growler = growler
end

Instance Method Details

#add_result(result) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
# File 'lib/outputs/growl_output.rb', line 10

def add_result(result)
  icon = get_icon(result[:state])

  if @growler.installed?
    @growler.notify {
      self.title = result[:title] + (result[:summary].nil? ? '' : ' - ' + result[:summary])
      self.message = result[:first]
      self.image = icon
    }
  end
end

#get_icon(state) ⇒ Object


22
23
24
# File 'lib/outputs/growl_output.rb', line 22

def get_icon(state)
  return File.join(File.expand_path(File.dirname(__FILE__)), '..', 'icons', "#{state.to_s}.png")
end

#start_runObject


7
8
# File 'lib/outputs/growl_output.rb', line 7

def start_run
end