guard-sass 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  class SassVersion
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
data/lib/guard/sass.rb CHANGED
@@ -44,7 +44,13 @@ module Guard
44
44
  :debug_info => options[:debug_info],
45
45
  }
46
46
  engine = ::Sass::Engine.new(content, sass_options)
47
- engine.render
47
+
48
+ begin
49
+ engine.render
50
+ rescue ::Sass::SyntaxError => e
51
+ puts "ERROR: #{e.message}\n on line #{e.sass_line} of #{e.sass_filename || file}"
52
+ nil
53
+ end
48
54
  end
49
55
 
50
56
  # Get the file path to output the css based on the file being
@@ -93,9 +99,12 @@ module Guard
93
99
  changed_files = paths.reject{ |f| ignored?(f) }.map do |file|
94
100
  css_file = get_output(file)
95
101
  begin
96
- File.open(css_file, 'w') {|f| f.write(build_sass(file)) }
97
- ::Guard::UI.info "-> rebuilt #{file}", :reset => true
98
- ::Guard::Notifier.notify("rebuilt #{file}", :title => "Guard::Sass", :image => :success) if options[:notification]
102
+ contents = build_sass(file)
103
+ if contents
104
+ File.open(css_file, 'w') {|f| f.write(contents) }
105
+ ::Guard::UI.info "-> rebuilt #{file}", :reset => true
106
+ ::Guard::Notifier.notify("rebuilt #{file}", :title => "Guard::Sass", :image => :success) if options[:notification]
107
+ end
99
108
  css_file
100
109
  rescue ::Sass::SyntaxError => e
101
110
  ::Guard::UI.error "Sass > #{e.sass_backtrace_str(file)}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-19 00:00:00.000000000 +01:00
12
+ date: 2011-09-01 00:00:00.000000000 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: guard
17
- requirement: &2156458040 !ruby/object:Gem::Requirement
17
+ requirement: &2156743000 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.4.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2156458040
25
+ version_requirements: *2156743000
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sass
28
- requirement: &2156457580 !ruby/object:Gem::Requirement
28
+ requirement: &2156742480 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '3.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2156457580
36
+ version_requirements: *2156742480
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2156457120 !ruby/object:Gem::Requirement
39
+ requirement: &2156742000 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.2
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2156457120
47
+ version_requirements: *2156742000
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
- requirement: &2156456660 !ruby/object:Gem::Requirement
50
+ requirement: &2156741520 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>'
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 2.0.0.rc
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2156456660
58
+ version_requirements: *2156741520
59
59
  description: Guard::Sass automatically rebuilds sass (like sass --watch)
60
60
  email:
61
61
  - m@hawx.me