jslint_on_rails 1.0.2 → 1.0.3
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/Gemfile +2 -5
- data/README.markdown +5 -0
- data/Rakefile +4 -1
- data/lib/jslint/config/jslint.yml +1 -1
- data/lib/jslint/lint.rb +1 -0
- data/lib/jslint/utils.rb +3 -3
- data/spec/lint_spec.rb +6 -2
- metadata +6 -4
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -10,6 +10,11 @@ itself written in JavaScript, and is run using the [Rhino](http://www.mozilla.or
|
|
10
10
|
Java). Any decent version of Java will do (and by decent I mean 5.0 or later).
|
11
11
|
|
12
12
|
|
13
|
+
## Compatibility
|
14
|
+
|
15
|
+
Latest version should be compatible with Ruby 1.9 and Rails 3 (and also with Ruby 1.8 and Rails 2, of course).
|
16
|
+
|
17
|
+
|
13
18
|
## Installation (Rails)
|
14
19
|
|
15
20
|
If you use Rails, you can install the library as a plugin - it's less work to set it up this way.
|
data/Rakefile
CHANGED
@@ -36,7 +36,7 @@ white: false # true if strict whitespace rules apply (see also 'indent' o
|
|
36
36
|
cap: false # true if upper case HTML should be allowed
|
37
37
|
css: true # true if CSS workarounds should be tolerated
|
38
38
|
debug: false # true if debugger statements should be allowed (set to false before going into production)
|
39
|
-
es5:
|
39
|
+
es5: false # true if ECMAScript 5 syntax should be allowed
|
40
40
|
evil: false # true if eval should be allowed
|
41
41
|
forin: true # true if unfiltered 'for in' statements should be allowed
|
42
42
|
fragment: true # true if HTML fragments should be allowed
|
data/lib/jslint/lint.rb
CHANGED
@@ -66,6 +66,7 @@ module JSLint
|
|
66
66
|
|
67
67
|
def files_matching_paths(options, field)
|
68
68
|
path_list = options[field] || @config[field.to_s] || []
|
69
|
+
path_list = [path_list] unless path_list.is_a?(Array)
|
69
70
|
file_list = path_list.map { |p| Dir[p] }.flatten
|
70
71
|
Utils.unique_files(file_list)
|
71
72
|
end
|
data/lib/jslint/utils.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require '
|
1
|
+
require 'fileutils'
|
2
2
|
|
3
3
|
module JSLint
|
4
4
|
|
5
|
-
VERSION = "1.0.
|
5
|
+
VERSION = "1.0.3"
|
6
6
|
DEFAULT_CONFIG_FILE = File.expand_path(File.dirname(__FILE__) + "/config/jslint.yml")
|
7
7
|
|
8
8
|
class << self
|
@@ -54,7 +54,7 @@ module JSLint
|
|
54
54
|
xputs "\n\nWarning: config file exists, so it won't be overwritten. " +
|
55
55
|
"You can copy it manually from the jslint_on_rails directory if you want to reset it."
|
56
56
|
else
|
57
|
-
|
57
|
+
FileUtils.copy(JSLint::DEFAULT_CONFIG_FILE, JSLint.config_path)
|
58
58
|
xputs "OK."
|
59
59
|
end
|
60
60
|
end
|
data/spec/lint_spec.rb
CHANGED
@@ -74,12 +74,16 @@ describe JSLint::Lint do
|
|
74
74
|
lint = JSLint::Lint.new
|
75
75
|
lint.instance_variable_set("@config", { 'debug' => true, 'semicolons' => false, 'linelength' => 120 })
|
76
76
|
setup_java(lint)
|
77
|
+
param_string = ""
|
77
78
|
lint.
|
78
79
|
should_receive(:call_java_with_status).
|
79
80
|
once.
|
80
|
-
with(an_instance_of(String), an_instance_of(String),
|
81
|
-
and_return
|
81
|
+
with(an_instance_of(String), an_instance_of(String), an_instance_of(String)).
|
82
|
+
and_return { |a, b, c| param_string = c; true }
|
82
83
|
lint.run
|
84
|
+
param_string.should =~ /semicolons=false/
|
85
|
+
param_string.should =~ /linelength=120/
|
86
|
+
param_string.should =~ /debug=true/
|
83
87
|
end
|
84
88
|
|
85
89
|
it "should pass space-separated list of files to JSLint" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 3
|
9
|
+
version: 1.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jakub Suder
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-11 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -54,6 +54,7 @@ rdoc_options: []
|
|
54
54
|
require_paths:
|
55
55
|
- lib
|
56
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
57
58
|
requirements:
|
58
59
|
- - ">="
|
59
60
|
- !ruby/object:Gem::Version
|
@@ -61,6 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
61
62
|
- 0
|
62
63
|
version: "0"
|
63
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
64
66
|
requirements:
|
65
67
|
- - ">="
|
66
68
|
- !ruby/object:Gem::Version
|
@@ -70,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
72
|
requirements:
|
71
73
|
- Java JRE (5.0 or later)
|
72
74
|
rubyforge_project:
|
73
|
-
rubygems_version: 1.3.
|
75
|
+
rubygems_version: 1.3.7
|
74
76
|
signing_key:
|
75
77
|
specification_version: 3
|
76
78
|
summary: JSLint JavaScript checker wrapped in a Ruby gem for easier use
|