Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/welaika/guard-compass int…
Browse files Browse the repository at this point in the history
…o welaika-master

Conflicts:
	lib/guard/compass.rb
  • Loading branch information
Rémy Coutable committed Oct 3, 2011
2 parents 9b8fd6e + 9b4c6de commit d62e445
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions lib/guard/compass.rb
Expand Up @@ -7,12 +7,24 @@
require 'compass'
require 'compass/commands'
require 'compass/logger'
require 'compass/compiler'

module Compass
class Compiler
alias :old_handle_exception :handle_exception
def handle_exception(sass_filename, css_filename, e)
old_handle_exception(sass_filename, css_filename, e)
# rethrow the exception, we need it to notificate the user!
raise Sass::SyntaxError, "[#{File.basename(sass_filename)}:#{e.sass_line}] #{e.message}"
end
end
end

module Guard
class Compass < Guard
attr_reader :updater, :working_path
attr_accessor :reporter

def initialize(watchers = [], options = {})
super
@reporter = Reporter.new
Expand Down Expand Up @@ -103,8 +115,15 @@ def cleanup_options

def perform
if valid_sass_path?
@updater.execute
true
begin
@updater.execute
Notifier.notify("No errors.", :title => "Compass")
true
rescue Sass::SyntaxError => e
Notifier.notify(e.message, :image => :failed, :title => "Compass")
reporter.failure "#{e.message}"
false
end
else
false
end
Expand All @@ -116,5 +135,6 @@ def create_updater
create_watchers
valid_sass_path?
end

end
end

0 comments on commit d62e445

Please sign in to comment.