Class: Guard::I18nJS::Notifier
- Inherits:
-
Object
- Object
- Guard::I18nJS::Notifier
- Defined in:
- lib/guard/i18n-js/notifier.rb
Class Method Summary collapse
-
.guard_image(result) ⇒ Object
failed | success.
- .guard_message(result, duration) ⇒ Object
- .notify(result, duration) ⇒ Object
Class Method Details
.guard_image(result) ⇒ Object
failed | success
17 18 19 20 21 22 23 |
# File 'lib/guard/i18n-js/notifier.rb', line 17 def guard_image(result) icon = if result :success else :failed end end |
.guard_message(result, duration) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/guard/i18n-js/notifier.rb', line 7 def (result, duration) case result when true "I18n::JS translations has been exported\nin %.1f seconds." % [duration] else "I18n::JS translations can't be exported,\nplease check manually." end end |
.notify(result, duration) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/guard/i18n-js/notifier.rb', line 25 def notify(result, duration) = (result, duration) image = guard_image(result) ::Guard::Notifier.notify(, :title => 'I18n::JS export', :image => image) end |