Class: Guard::Annotate::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/annotate/notifier.rb

Class Method Summary collapse

Class Method Details

.guard_image(result) ⇒ Object


16
17
18
# File 'lib/guard/annotate/notifier.rb', line 16

def guard_image( result )
  result ? :success : :failed
end

.guard_message(result, duration) ⇒ Object


7
8
9
10
11
12
13
14
# File 'lib/guard/annotate/notifier.rb', line 7

def guard_message( result, duration )
  case result
  when true
    "Annotate has been run successfully\nin %0.2f seconds." % [duration]
  else
    "Annotate run has failed!\nPlease check manually."
  end
end

.notify(result, duration) ⇒ Object


20
21
22
23
24
25
# File 'lib/guard/annotate/notifier.rb', line 20

def notify( result, duration )
  message = guard_message( result, duration )
  image   = guard_image( result )

  Compat::UI.notify( message, :title => 'Annotate complete', :image => image )
end