Skip to content

Commit

Permalink
guard is no longer crashing when haml fails to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Immanuel Häussermann authored and Immanuel Häussermann committed Aug 13, 2011
1 parent 7c08e64 commit 5bb7d0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 0.3.1.
* guard-haml is no longer crashing guard when HAML fails to compile

## 0.3.0
* Added the input option, to exclude a path from the output path. (github.com/draiken)

Expand Down
8 changes: 6 additions & 2 deletions lib/guard/haml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ def initialize(watchers = [], options = {})

def compile_haml file
content = File.new(file).read
engine = ::Haml::Engine.new(content, (@options[:haml_options] || {}))
engine.render
begin
engine = ::Haml::Engine.new(content, (@options[:haml_options] || {}))
engine.render
rescue StandardError => error
::Guard::UI.info "HAML Error: " + error.message
end
end

# Get the file path to output the html based on the file being
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/haml/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Guard
class HamlVersion
VERSION = '0.3.0'
VERSION = '0.3.1'
end
end

0 comments on commit 5bb7d0d

Please sign in to comment.