lib/guard/notifiers/emacs.rb in guard-1.3.3 vs lib/guard/notifiers/emacs.rb in guard-1.4.0
- old
+ new
@@ -3,13 +3,13 @@
module Guard
module Notifier
# Default options for EmacsClient
DEFAULTS = {
- :client => 'emacsclient',
+ :client => 'emacsclient',
:success => 'ForestGreen',
- :failed => 'Firebrick',
+ :failed => 'Firebrick',
:default => 'Black',
}
# Send a notification to Emacs with emacsclient (http://www.emacswiki.org/emacs/EmacsClient).
#
@@ -23,13 +23,13 @@
#
# @param [Boolean] silent true if no error messages should be shown
# @return [Boolean] the availability status
#
def available?(silent = false)
- result = `#{DEFAULTS[:client]} --eval '1' 2> /dev/null || echo 'N/A'`
+ result = `#{ DEFAULTS[:client] } --eval '1' 2> /dev/null || echo 'N/A'`
- if result.chomp! == "N/A"
+ if result.chomp! == 'N/A'
false
else
true
end
end
@@ -43,10 +43,10 @@
# @param [Hash] options additional notification library options
# @option options [Boolean] sticky make the notification sticky
# @option options [String, Integer] priority specify an int or named key (default is 0)
#
def notify(type, title, message, image, options = { })
- system(%(#{DEFAULTS[:client]} --eval "(set-face-background 'modeline \\"#{emacs_color(type)}\\")"))
+ system(%(#{ DEFAULTS[:client] } --eval "(set-face-background 'modeline \\"#{ emacs_color(type) }\\")"))
end
# Get the Emacs color for the notification type.
# You can configure your own color by overwrite the defaults.
#