Module: HJ7::Notifier
- Defined in:
- lib/hj7/notifier.rb
Constant Summary collapse
- APPLICATION_NAME =
"Jekyll"
Class Method Summary collapse
Class Method Details
.enabled? ⇒ Boolean
39 40 41 |
# File 'lib/hj7/notifier.rb', line 39 def self.enabled? ENV["JEKYLL_NOTIFY"] == "true" end |
.notify(message, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/hj7/notifier.rb', line 23 def self.notify(, = {}) if enabled? image = .delete(:image) title = .delete(:title) || "Jekyll" case RbConfig::CONFIG["target_os"] when /darwin/i notify_mac(title, , image, ) when /linux/i notify_linux(title, , image, ) when /mswin|mingw/i notify_windows(title, , image, ) end end end |
.turn_off ⇒ Object
6 7 8 |
# File 'lib/hj7/notifier.rb', line 6 def self.turn_off ENV["JEKYLL_NOTIFY"] = "false" end |
.turn_on ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/hj7/notifier.rb', line 10 def self.turn_on ENV["JEKYLL_NOTIFY"] = "true" case RbConfig::CONFIG["target_os"] when /darwin/i require_growl when /linux/i require_libnotify when /mswin|mingw/i require_rbnotifu end end |