rails_best_practices 1.19.5 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +3 -18
- data/Gemfile.lock +4 -4
- data/Rakefile +0 -17
- data/lib/rails_best_practices/reviews/always_add_db_index_review.rb +2 -2
- data/lib/rails_best_practices/reviews/use_model_association_review.rb +1 -1
- data/lib/rails_best_practices/version.rb +1 -1
- data/rails_best_practices.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b66ea6e0e742d6db68f867fed12f8242aa0d767b7b3fb4728043c97984f455a
|
4
|
+
data.tar.gz: 6f8ff9290459f8436908396fec8612d6050c7f5b278697475c4601e8931c0c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '03850b2873726ec5f3928bc1a846320927c56793c71221c715bbbc630cd1f10333b52ac9a713a78db3cbf1db6e2f25a34493d06bcce76d184f2447f5d888deb1'
|
7
|
+
data.tar.gz: 72586f6144df24dd9fd11861c443554f3903bc0cd8401bd08b1e6a89ff356d545b475b8e465b7e95e1803dd198517695fb91d81d6a746df9654e51525e638365
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,30 +1,15 @@
|
|
1
1
|
# Next Release
|
2
2
|
|
3
|
-
## 1.
|
3
|
+
## 1.20.0 (2020-02-29)
|
4
4
|
|
5
|
+
* Support ruby 2.7
|
5
6
|
* Add the link format for vscode
|
6
|
-
* Use code_analyzer 0.5.1
|
7
|
-
|
8
|
-
## 1.19.4
|
9
|
-
|
10
7
|
* Add cli class
|
11
|
-
|
12
|
-
## 1.19.3
|
13
|
-
|
8
|
+
* Add table_name and module_prefix to model ignored methods
|
14
9
|
* Fix false positive remove unused method for around_action in
|
15
10
|
controller
|
16
11
|
* Fix current_class_name in end_class callback
|
17
12
|
|
18
|
-
## 1.19.2
|
19
|
-
|
20
|
-
* Integrate with awesomecode.io
|
21
|
-
* Update to require_all 2.x
|
22
|
-
|
23
|
-
## 1.19.1
|
24
|
-
|
25
|
-
* Add table_name and module_prefix to model ignored methods
|
26
|
-
* Forcing requrie_all version
|
27
|
-
|
28
13
|
## 1.19.0 (2017-07-26)
|
29
14
|
|
30
15
|
* RestrictAutoGeneratedRoutesCheck is compatibale with rails api_only
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_best_practices (1.
|
4
|
+
rails_best_practices (1.20.0)
|
5
5
|
activesupport
|
6
6
|
code_analyzer (>= 0.5.1)
|
7
7
|
erubis
|
@@ -66,7 +66,7 @@ GEM
|
|
66
66
|
pry (0.12.2)
|
67
67
|
coderay (~> 1.1.0)
|
68
68
|
method_source (~> 0.9.0)
|
69
|
-
rake (
|
69
|
+
rake (13.0.1)
|
70
70
|
rb-fsevent (0.10.3)
|
71
71
|
rb-inotify (0.10.1)
|
72
72
|
ffi (~> 1.0)
|
@@ -113,9 +113,9 @@ DEPENDENCIES
|
|
113
113
|
haml
|
114
114
|
pry
|
115
115
|
rails_best_practices!
|
116
|
-
rake
|
116
|
+
rake
|
117
117
|
rspec (~> 2.14.0)
|
118
118
|
slim
|
119
119
|
|
120
120
|
BUNDLED WITH
|
121
|
-
2.1.
|
121
|
+
2.1.4
|
data/Rakefile
CHANGED
@@ -1,18 +1 @@
|
|
1
|
-
require 'bundler'
|
2
1
|
require 'bundler/gem_tasks'
|
3
|
-
|
4
|
-
Bundler.setup
|
5
|
-
|
6
|
-
require 'rake'
|
7
|
-
require 'rspec'
|
8
|
-
require 'rspec/core/rake_task'
|
9
|
-
|
10
|
-
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
11
|
-
require 'rails_best_practices/version'
|
12
|
-
|
13
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
14
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
15
|
-
end
|
16
|
-
|
17
|
-
task default: :spec
|
18
|
-
task test: :spec
|
@@ -146,7 +146,7 @@ module RailsBestPractices
|
|
146
146
|
def remove_table_not_exist_foreign_keys
|
147
147
|
@foreign_keys.each do |table, foreign_keys|
|
148
148
|
foreign_keys.delete_if do |key|
|
149
|
-
if key =~ /_id$/
|
149
|
+
if key.is_a?(String) && key =~ /_id$/
|
150
150
|
class_name = Prepares.model_associations.get_association_class_name(table, key[0..-4])
|
151
151
|
class_name ? !@table_nodes[class_name.gsub('::', '').tableize] : !@table_nodes[key[0..-4].pluralize]
|
152
152
|
end
|
@@ -157,7 +157,7 @@ module RailsBestPractices
|
|
157
157
|
# remove the non foreign keys with only _type column.
|
158
158
|
def remove_only_type_foreign_keys
|
159
159
|
@foreign_keys.each do |_table, foreign_keys|
|
160
|
-
foreign_keys.delete_if { |key| key =~ /_type$/ }
|
160
|
+
foreign_keys.delete_if { |key| key.is_a?(String) && key =~ /_type$/ }
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
@@ -46,7 +46,7 @@ module RailsBestPractices
|
|
46
46
|
# check an attribute assignment node, if its message is xxx_id,
|
47
47
|
# then remember the receiver of the attribute assignment in @assignments.
|
48
48
|
def attribute_assignment(node)
|
49
|
-
if node.left_value.message.to_s =~ /_id$/
|
49
|
+
if node.left_value.message.is_a?(Sexp) && node.left_value.message.to_s =~ /_id$/
|
50
50
|
receiver = node.left_value.receiver.to_s
|
51
51
|
@assignments[receiver] = true
|
52
52
|
end
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency('awesome_print')
|
29
29
|
s.add_development_dependency('bundler')
|
30
30
|
s.add_development_dependency('haml')
|
31
|
-
s.add_development_dependency('rake'
|
31
|
+
s.add_development_dependency('rake')
|
32
32
|
s.add_development_dependency('rspec')
|
33
33
|
s.add_development_dependency('slim')
|
34
34
|
|
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.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: rake
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rspec
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -399,7 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
399
399
|
- !ruby/object:Gem::Version
|
400
400
|
version: 1.3.6
|
401
401
|
requirements: []
|
402
|
-
rubygems_version: 3.0.
|
402
|
+
rubygems_version: 3.1.0.pre1
|
403
403
|
signing_key:
|
404
404
|
specification_version: 4
|
405
405
|
summary: a code metric tool for rails codes.
|