check_js 0.1.0 → 0.1.1

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -25,12 +25,11 @@ files.each do |file_path|
25
25
  puts "\e[32m>>>>\e[0m Checking syntax for #{file_path} ..."
26
26
  ret = CheckJS.check_syntax(file_path)
27
27
  ok = ok && ret
28
- puts ""
28
+ puts "" if !ret
29
29
 
30
30
  sleep 0.2
31
31
  end
32
32
 
33
33
  if !ok
34
- puts "\e[31mERROR:\e[0m Aborting commit..."
35
34
  exit 255
36
35
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{check_js}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David A. Cuadrado"]
12
- s.date = %q{2011-01-14}
12
+ s.date = %q{2011-03-29}
13
13
  s.description = %q{small utility to check the JavaScript syntax of a list of files. it also allow to install it as a git hook}
14
14
  s.email = %q{krawek@gmail.com}
15
15
  s.executables = ["check_js", "check_js_hook"]
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  "VERSION",
29
29
  "bin/check_js",
30
30
  "bin/check_js_hook",
31
+ "check_js.gemspec",
31
32
  "lib/check_js.rb",
32
33
  "lib/check_js/hook.rb",
33
34
  "lib/jar/js_compiler.jar",
@@ -37,7 +38,7 @@ Gem::Specification.new do |s|
37
38
  s.homepage = %q{http://github.com/dcu/check_js}
38
39
  s.licenses = ["MIT"]
39
40
  s.require_paths = ["lib"]
40
- s.rubygems_version = %q{1.3.7}
41
+ s.rubygems_version = %q{1.6.2}
41
42
  s.summary = %q{small utility to check the JavaScript syntax of a list of files}
42
43
  s.test_files = [
43
44
  "spec/check_js_spec.rb",
@@ -45,7 +46,6 @@ Gem::Specification.new do |s|
45
46
  ]
46
47
 
47
48
  if s.respond_to? :specification_version then
48
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
49
  s.specification_version = 3
50
50
 
51
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  require 'fileutils'
3
+ require 'iconv'
2
4
 
3
5
  module CheckJS
4
6
  COMPILER = File.expand_path("../jar/js_compiler.jar", __FILE__)
@@ -12,6 +14,7 @@ module CheckJS
12
14
  File.open(file, "r") do |f|
13
15
  count = 0
14
16
  f.each_line do |line|
17
+ line = Iconv.new('UTF-8//IGNORE', 'UTF-8').iconv(line)
15
18
  if line =~ /console\.log\s*\(/
16
19
  $stderr.puts "#{file}:#{count}: WARNING - Suspicious code. console.log() only works when the inspector is enabled"
17
20
  $stderr.puts " #{line.strip}"
@@ -24,6 +24,9 @@ Dir.chdir(working_dir) do
24
24
  ok = system("check_js #{files.join(' ')}")
25
25
  end
26
26
 
27
- exit(1) if !ok
27
+ if !ok
28
+ puts "\e[31mERROR:\e[0m Aborting commit..."
29
+ exit(1)
30
+ end
28
31
  end
29
32
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: check_js
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
4
+ prerelease:
5
+ version: 0.1.1
11
6
  platform: ruby
12
7
  authors:
13
8
  - David A. Cuadrado
@@ -15,71 +10,53 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-01-14 00:00:00 -05:00
13
+ date: 2011-03-29 00:00:00 -05:00
19
14
  default_executable:
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
17
+ name: rspec
18
+ requirement: &id001 !ruby/object:Gem::Requirement
23
19
  none: false
24
20
  requirements:
25
21
  - - ~>
26
22
  - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 2
30
- - 3
31
- - 0
32
23
  version: 2.3.0
33
- requirement: *id001
34
- prerelease: false
35
24
  type: :development
36
- name: rspec
25
+ prerelease: false
26
+ version_requirements: *id001
37
27
  - !ruby/object:Gem::Dependency
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
28
+ name: bundler
29
+ requirement: &id002 !ruby/object:Gem::Requirement
39
30
  none: false
40
31
  requirements:
41
32
  - - ~>
42
33
  - !ruby/object:Gem::Version
43
- hash: 23
44
- segments:
45
- - 1
46
- - 0
47
- - 0
48
34
  version: 1.0.0
49
- requirement: *id002
50
- prerelease: false
51
35
  type: :development
52
- name: bundler
36
+ prerelease: false
37
+ version_requirements: *id002
53
38
  - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
39
+ name: jeweler
40
+ requirement: &id003 !ruby/object:Gem::Requirement
55
41
  none: false
56
42
  requirements:
57
43
  - - ~>
58
44
  - !ruby/object:Gem::Version
59
- hash: 7
60
- segments:
61
- - 1
62
- - 5
63
- - 2
64
45
  version: 1.5.2
65
- requirement: *id003
66
- prerelease: false
67
46
  type: :development
68
- name: jeweler
47
+ prerelease: false
48
+ version_requirements: *id003
69
49
  - !ruby/object:Gem::Dependency
70
- version_requirements: &id004 !ruby/object:Gem::Requirement
50
+ name: rcov
51
+ requirement: &id004 !ruby/object:Gem::Requirement
71
52
  none: false
72
53
  requirements:
73
54
  - - ">="
74
55
  - !ruby/object:Gem::Version
75
- hash: 3
76
- segments:
77
- - 0
78
56
  version: "0"
79
- requirement: *id004
80
- prerelease: false
81
57
  type: :development
82
- name: rcov
58
+ prerelease: false
59
+ version_requirements: *id004
83
60
  description: small utility to check the JavaScript syntax of a list of files. it also allow to install it as a git hook
84
61
  email: krawek@gmail.com
85
62
  executables:
@@ -121,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
98
  requirements:
122
99
  - - ">="
123
100
  - !ruby/object:Gem::Version
124
- hash: 3
101
+ hash: 3613726645404951886
125
102
  segments:
126
103
  - 0
127
104
  version: "0"
@@ -130,14 +107,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
107
  requirements:
131
108
  - - ">="
132
109
  - !ruby/object:Gem::Version
133
- hash: 3
134
- segments:
135
- - 0
136
110
  version: "0"
137
111
  requirements: []
138
112
 
139
113
  rubyforge_project:
140
- rubygems_version: 1.3.7
114
+ rubygems_version: 1.6.2
141
115
  signing_key:
142
116
  specification_version: 3
143
117
  summary: small utility to check the JavaScript syntax of a list of files