guard-jslint-on-rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/guard/jslint-on-rails.rb +14 -7
  2. metadata +3 -3
@@ -1,19 +1,26 @@
1
1
  require 'guard'
2
2
  require 'guard/guard'
3
+ require 'guard/notifier'
3
4
  require 'jslint'
4
5
 
5
6
  module Guard
6
7
  class JslintOnRails < Guard
7
- VERSION = '0.0.4'
8
+ VERSION = '0.0.5'
8
9
 
9
10
  def run_on_change(paths)
10
- capture_output do
11
- lint = JSLint::Lint.new(
12
- :paths => paths,
13
- :config_path => File.join(Dir.pwd, 'config', 'jslint.yml')
14
- )
15
- lint.run #raises LintCheckFailure if failure
11
+ error = nil
12
+ begin
13
+ output = capture_output do
14
+ lint = JSLint::Lint.new(
15
+ :paths => paths,
16
+ :config_path => File.join(Dir.pwd, 'config', 'jslint.yml')
17
+ )
18
+ lint.run
19
+ end
20
+ rescue JSLint::LintCheckFailure => e
21
+ error = e
16
22
  end
23
+ Notifier.notify((error ? 'failed' : 'passed'), :title => 'JSLint results', :image => (error ? :failed : :success))
17
24
  true
18
25
  end
19
26
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jslint-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek