rails_best_practices 1.18.0 → 1.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rails_best_practices/core/runner.rb +1 -1
- data/lib/rails_best_practices/reviews/not_rescue_exception_review.rb +1 -1
- data/lib/rails_best_practices/version.rb +1 -1
- data/spec/rails_best_practices/reviews/not_rescue_exception_review_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b28f335fee20969fe2276bdd1167772552262162
|
4
|
+
data.tar.gz: aff5bdb928fbae84063f42e0b79bc72c2766d11c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9650af54486b7bf655ed79287e43e70c43314d2353a3a68680ff9a17a7c4548056b48b67e3e0ce7d4d9af76f5d087138d6119e6026c816f70e566e63b38883ca
|
7
|
+
data.tar.gz: ea4bb8533886d4bd11e25af6eb19c2a354aae861ccf7f9fba22636b0d78da6d97a15626984c9d7ec72b48440107a1766790845c4df8964621e9cbf7fb5811695
|
data/CHANGELOG.md
CHANGED
@@ -128,7 +128,7 @@ module RailsBestPractices
|
|
128
128
|
elsif filename =~ /.*\.haml$/
|
129
129
|
begin
|
130
130
|
require 'haml'
|
131
|
-
content = Haml::Engine.new(content
|
131
|
+
content = Haml::Engine.new(content).precompiled
|
132
132
|
# remove \xxx characters
|
133
133
|
content.gsub!(/\\\d{3}/, '')
|
134
134
|
rescue LoadError
|
@@ -18,7 +18,7 @@ module RailsBestPractices
|
|
18
18
|
# check rescue node to see if its type is Exception
|
19
19
|
add_callback :start_rescue do |rescue_node|
|
20
20
|
if rescue_node.exception_classes.any? { |rescue_class| "Exception" == rescue_class.to_s }
|
21
|
-
add_error "
|
21
|
+
add_error "Don't rescue Exception", rescue_node.file, rescue_node.exception_classes.first.line_number
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -16,7 +16,7 @@ module RailsBestPractices
|
|
16
16
|
EOF
|
17
17
|
runner.review('app/helpers/posts_helper.rb', content)
|
18
18
|
expect(runner.errors.size).to eq(1)
|
19
|
-
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:3 -
|
19
|
+
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:3 - Don't rescue Exception")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should not rescue exception in method rescue without named var" do
|
@@ -29,7 +29,7 @@ module RailsBestPractices
|
|
29
29
|
EOF
|
30
30
|
runner.review('app/helpers/posts_helper.rb', content)
|
31
31
|
expect(runner.errors.size).to eq(1)
|
32
|
-
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:3 -
|
32
|
+
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:3 - Don't rescue Exception")
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should not rescue exception in block rescue with named var" do
|
@@ -44,7 +44,7 @@ module RailsBestPractices
|
|
44
44
|
EOF
|
45
45
|
runner.review('app/helpers/posts_helper.rb', content)
|
46
46
|
expect(runner.errors.size).to eq(1)
|
47
|
-
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:4 -
|
47
|
+
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:4 - Don't rescue Exception")
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should not rescue exception in block rescue without named var" do
|
@@ -59,7 +59,7 @@ module RailsBestPractices
|
|
59
59
|
EOF
|
60
60
|
runner.review('app/helpers/posts_helper.rb', content)
|
61
61
|
expect(runner.errors.size).to eq(1)
|
62
|
-
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:4 -
|
62
|
+
expect(runner.errors[0].to_s).to eq("app/helpers/posts_helper.rb:4 - Don't rescue Exception")
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should allow rescue implicit StandardError in block rescue without named var" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_best_practices
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -419,7 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
419
419
|
version: 1.3.6
|
420
420
|
requirements: []
|
421
421
|
rubyforge_project:
|
422
|
-
rubygems_version: 2.
|
422
|
+
rubygems_version: 2.6.10
|
423
423
|
signing_key:
|
424
424
|
specification_version: 4
|
425
425
|
summary: a code metric tool for rails codes.
|