Closed stefanoverna closed 11 years ago
Hi Stefan,
I can live with that code :) No time to merge now, but I definitly will.
Thanks!!
I just wrote something that adds logging of all message types to the notifier. Your call whether or not it's intrusive.
module Compass
class GuardLogger < Logger
ACTION_IMAGES = {
:error => :failed,
:warning => :failed,
:compile => :success,
:overwrite => :success,
:create => :success,
:remove => :success,
:exists => :success,
:directory => :success,
:identical => :success,
:convert => :success,
:unchanged => :success
}
def record(action, *arguments)
super
image = ACTION_IMAGES[action]
msg = "#{action} #{arguments.join(' ')}"
::Guard::Notifier.notify(msg, {:title => 'Compass', :image => image})
end
end
module Commands
class UpdateProject
def new_compiler_instance_with_guard(additional_options = {})
additional_options[:logger] = ::Compass::GuardLogger.new
new_compiler_instance_without_guard(additional_options)
end
alias :new_compiler_instance_without_guard :new_compiler_instance
alias :new_compiler_instance :new_compiler_instance_with_guard
end
end
end
Hi there, this might interest you, as it adds growl notifications to guard-compass. Don't know if this approach it's too hackish for you, but IFAIK it's the only way to do it.