Class: Guard::Npm::Notifier
- Inherits:
-
Object
- Object
- Guard::Npm::Notifier
- Defined in:
- lib/guard/npm/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
16 17 18 19 20 21 22 |
# File 'lib/guard/npm/notifier.rb', line 16 def self.guard_image(result) icon = if result :success else :failed end end |
.guard_message(result, duration) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/guard/npm/notifier.rb', line 6 def self.(result, duration) case result when true "package.json has been installed\nin %.1f seconds." % [duration] else "package.json can't be installed,\nplease check manually." end end |
.notify(result, duration) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/guard/npm/notifier.rb', line 24 def self.notify(result, duration) = (result, duration) image = guard_image(result) ::Guard::Notifier.notify(, :title => 'npm install', :image => image) end |