Class: Guard::RailsBestPractices::Notifier
- Inherits:
-
Object
- Object
- Guard::RailsBestPractices::Notifier
- Defined in:
- lib/guard/rails_best_practices/notifier.rb
Class Method Summary collapse
- .guard_image(result) ⇒ Object
- .guard_message(result, duration) ⇒ Object
- .notify(result, duration) ⇒ Object
Class Method Details
.guard_image(result) ⇒ Object
18 19 20 |
# File 'lib/guard/rails_best_practices/notifier.rb', line 18 def guard_image( result ) result ? :success : :failed end |
.guard_message(result, duration) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/guard/rails_best_practices/notifier.rb', line 9 def ( result, duration ) case result when true "Rails Best Practices checklist has been run successfully\nin %0.2f seconds." % [duration] else "Rails Best Practices checklist run has failed!\nPlease check manually." end end |
.notify(result, duration) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/guard/rails_best_practices/notifier.rb', line 22 def notify( result, duration ) = ( result, duration ) image = guard_image( result ) ::Guard::Notifier.notify( , :title => 'Rails Best Practices checklist complete', :image => image ) end |