rubocop-rhino-project 0.25.0.beta.16 → 0.25.0.beta.17
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0aa952e5ca28ea3471bfd2ad90e8463d6f27cb37c183af01cc15bbeddf631b6
|
4
|
+
data.tar.gz: a8cfd18969666d08cf7001692dec742b4e74139636dbc8d5af3d5c9b2c6e636f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e18ff6aeedaf0a2664992bf4e501b7643cceef9d57f4c07dc9942c81cb00d48e86dd6b84b1eb8424c2e0e3b5f53973e245f04fd08e65837e04f1c9a2a0a0e34
|
7
|
+
data.tar.gz: 23ece285fecdd74d2d2dd73cb61af6671b768bbf11fdb5877d95ef28bb8ac4f340e4c7b73cc85b590daa952c8f724283b93c861dd14219c31d68a7c0f727e2e1
|
@@ -25,13 +25,14 @@ module RuboCop
|
|
25
25
|
# rhino_references %i[user category]
|
26
26
|
# end
|
27
27
|
#
|
28
|
-
class OwnerSpecified <
|
29
|
-
MSG = "ActiveRecord models listed in rhino.rb must specify exactly one ownership method (rhino_owner_global,
|
28
|
+
class OwnerSpecified < Base
|
29
|
+
MSG = "ActiveRecord models listed in rhino.rb must specify exactly one ownership method (rhino_owner_global, rhino_owner_base, or rhino_owner :symbol)."
|
30
30
|
|
31
31
|
REQUIRED_METHODS = [:rhino_owner_global, :rhino_owner_base, :rhino_owner].freeze
|
32
32
|
|
33
|
-
def
|
34
|
-
|
33
|
+
def on_new_investigation
|
34
|
+
# processed_source is automatically available in RuboCop v1 Base class
|
35
|
+
return unless applicable_model?
|
35
36
|
|
36
37
|
class_node = find_class_node(processed_source.ast)
|
37
38
|
return unless class_node
|
@@ -44,15 +45,15 @@ module RuboCop
|
|
44
45
|
end
|
45
46
|
|
46
47
|
private
|
47
|
-
def applicable_model?
|
48
|
-
model_name = extract_class_name
|
48
|
+
def applicable_model?
|
49
|
+
model_name = extract_class_name
|
49
50
|
|
50
|
-
return false if inherits_from_rhino?
|
51
|
+
return false if inherits_from_rhino?
|
51
52
|
|
52
53
|
rhino_resources.include?(model_name)
|
53
54
|
end
|
54
55
|
|
55
|
-
def extract_class_name
|
56
|
+
def extract_class_name
|
56
57
|
class_node = find_class_node(processed_source.ast)
|
57
58
|
return unless class_node
|
58
59
|
|
@@ -73,7 +74,7 @@ module RuboCop
|
|
73
74
|
end
|
74
75
|
|
75
76
|
# Check if the class inherits from a Rhino:: class
|
76
|
-
def inherits_from_rhino?
|
77
|
+
def inherits_from_rhino?
|
77
78
|
class_node = find_class_node(processed_source.ast)
|
78
79
|
return false unless class_node
|
79
80
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rhino-project
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.25.0.beta.
|
4
|
+
version: 0.25.0.beta.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-22 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|