dark_finger 0.1.2 → 0.1.3
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: c04e8ab4c8e6ae562966f4a5609d9d3df06b486fbf52ec977be9f54635577b4c
|
4
|
+
data.tar.gz: 5d54afcdb9d594e2574302612a433b278673acae3692911807f22c6d80a12675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c944d2bd65bdd049730b86c44a16f551e3c5de9d79d71f442b92459007a8b3ec3bd2c3220436dba9f065e607041bb3ea9435f010c2ca0e0295aa695b5e25e6f
|
7
|
+
data.tar.gz: 7fec157a7910e6a18dc9f12495ff38faec581a190097e3e4300fab723c58acd4ad81201985e0f4f19eac422b8749773b546768b1bcd0df888cdfb57fd01453f0
|
data/lib/dark_finger/version.rb
CHANGED
@@ -4,6 +4,7 @@ module RuboCop
|
|
4
4
|
class ActiveModelNodeDecorator < SimpleDelegator
|
5
5
|
def initialize(node)
|
6
6
|
super
|
7
|
+
raise "Cannot decorate nil node" if node.nil?
|
7
8
|
end
|
8
9
|
|
9
10
|
def node_type
|
@@ -56,8 +57,19 @@ module RuboCop
|
|
56
57
|
private
|
57
58
|
|
58
59
|
def nested_in_with_options?
|
59
|
-
|
60
|
-
|
60
|
+
parent_is_with_options? || grandparent_is_with_options?
|
61
|
+
end
|
62
|
+
|
63
|
+
def parent_is_with_options?
|
64
|
+
parent.respond_to?(:method_name) && parent&.method_name == :with_options
|
65
|
+
end
|
66
|
+
|
67
|
+
def grandparent_is_with_options?
|
68
|
+
grandparent = parent&.parent
|
69
|
+
return false unless grandparent
|
70
|
+
return false unless grandparent.respond_to?(:method_name)
|
71
|
+
|
72
|
+
parent.begin_type? && grandparent.method_name == :with_options
|
61
73
|
end
|
62
74
|
|
63
75
|
def nested_directly_in_class?
|