guard-jslint-on-rails 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/guard/jslint-on-rails.rb +14 -7
- 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.
|
8
|
+
VERSION = '0.0.5'
|
8
9
|
|
9
10
|
def run_on_change(paths)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Sonnek
|