jslint_on_rails 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,8 +1,5 @@
1
- disable_system_gems
2
- clear_sources
3
- source "http://gemcutter.org"
4
- source "http://gems.github.com"
5
- bundle_path 'gems'
1
+ source "http://rubygems.org"
6
2
 
7
3
  gem 'rspec'
8
4
  gem 'fakefs'
5
+ gem 'rake'
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
@@ -1,4 +1,7 @@
1
- require 'gems/environment'
1
+ require "rubygems"
2
+ require "bundler"
3
+ Bundler.setup
4
+
2
5
  require 'spec/rake/spectask'
3
6
 
4
7
  desc 'Run the specs'
@@ -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: true # true if ECMAScript 5 syntax should be allowed
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 'ftools'
1
+ require 'fileutils'
2
2
 
3
3
  module JSLint
4
4
 
5
- VERSION = "1.0.2"
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
- File.copy(JSLint::DEFAULT_CONFIG_FILE, JSLint.config_path)
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), /semicolons=false,linelength=120,debug=true/).
81
- and_return(true)
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
- - 2
9
- version: 1.0.2
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-04-10 00:00:00 +02:00
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.6
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