jslintrb_v8 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jslintrb-v8.rb +13 -8
- metadata +4 -4
data/lib/jslintrb-v8.rb
CHANGED
@@ -20,15 +20,23 @@ require 'v8'
|
|
20
20
|
# Here is an example rake task:
|
21
21
|
# require 'jslintrb-v8'
|
22
22
|
# task :jslint do
|
23
|
-
# jsl = JSLint.new(
|
23
|
+
# jsl = JSLint.new(
|
24
|
+
# :undef => false,
|
25
|
+
# :strict => false,
|
26
|
+
# :nomen => false,
|
27
|
+
# :onevar => false,
|
28
|
+
# :newcap => false
|
29
|
+
# )
|
24
30
|
# errors = []
|
25
|
-
#
|
31
|
+
# path = File.join('javascripts', '**', '*.js')
|
32
|
+
# Dir[path].each do |f|
|
26
33
|
# e = jsl.check(File.read(f))
|
27
34
|
# errors << "\nIn [#{f}]:\n#{e}\n" if e
|
28
35
|
# end
|
29
36
|
# if errors.empty?
|
30
37
|
# puts "JSLinty-fresh!"
|
31
38
|
# else
|
39
|
+
# $stderr.write(errors.join("\n")+"\n");
|
32
40
|
# raise "JSLint Errors Found"
|
33
41
|
# end
|
34
42
|
# end
|
@@ -154,12 +162,9 @@ class JSLint
|
|
154
162
|
context['JSLintRBwidget'] = @widget
|
155
163
|
context['JSLintRBreportErrors'] = lambda{|js_errors|
|
156
164
|
js_errors.each do |e|
|
157
|
-
|
158
|
-
e
|
159
|
-
|
160
|
-
"character #{e['character'].to_i + 1}: #{e['reason']}"
|
161
|
-
errors << " #{e['evidence']}"
|
162
|
-
end
|
165
|
+
errors << "Error at line #{e['line'].to_i + 1} " +
|
166
|
+
"character #{e['character'].to_i + 1}: #{e['reason']}"
|
167
|
+
errors << " #{e['evidence']}"
|
163
168
|
end
|
164
169
|
}
|
165
170
|
context.eval %{
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jslintrb_v8
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nick Gauthier
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-28 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|