Class: GrowlOutput
- Inherits:
-
Object
- Object
- GrowlOutput
- Defined in:
- lib/outputs/growl_output.rb
Instance Method Summary collapse
- #add_result(result) ⇒ Object
- #get_icon(state) ⇒ Object
-
#initialize(growler) ⇒ GrowlOutput
constructor
A new instance of GrowlOutput.
- #start_run ⇒ Object
Constructor Details
#initialize(growler) ⇒ GrowlOutput
Returns a new instance of 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. = 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.(File.dirname(__FILE__)), '..', 'icons', "#{state.to_s}.png") end |
#start_run ⇒ Object
7 8 |
# File 'lib/outputs/growl_output.rb', line 7 def start_run end |