rubocop-fourshark 0.8.5 → 0.8.6
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/rubocop/cop/style/disallow_delegate.rb +7 -4
- data/lib/rubocop/fourshark/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bdc31121f34ef40cca25af1bc804caafecc8b8f58fd2996457cd01d82b98502
|
|
4
|
+
data.tar.gz: 26bbc30201fe22eef3477a20ce1eaf7016ee020a1ed93f53134429654da4a11d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce23cde85c85d07932802b8bc89aa7c48f047cd274f59ff7d8c32b5e5e490e4bc46f118bb0e6216796cc774f9dc7c687bc464d33ac59361885a8bab2dd865edb
|
|
7
|
+
data.tar.gz: 616ed09b7f636b5cc4931894d86063a62b9e7357cf35802dee67f6d4a2c77ab8523131519ced29806cb6e1bd862ce8771931401411b3b1e0d59ebe6fabc5b575
|
data/CHANGELOG.md
CHANGED
|
@@ -212,11 +212,14 @@ module RuboCop
|
|
|
212
212
|
mixes_in_enumerable?(body)
|
|
213
213
|
end
|
|
214
214
|
|
|
215
|
-
#
|
|
216
|
-
#
|
|
215
|
+
# A body that passes the object's own state is composing, not forwarding:
|
|
216
|
+
# it collapses `owner.collaborator.message(owner.state)` into
|
|
217
|
+
# `owner.message`, so the method hides the passing of a parameter the
|
|
218
|
+
# object itself holds. How far the collaborator sits is not part of that
|
|
219
|
+
# judgement — depth changes the path to the collaborator, never who the
|
|
220
|
+
# answer is about. A body that passes nothing, or passes a parameter the
|
|
221
|
+
# caller handed in, composes nothing and stays an offense at any depth.
|
|
217
222
|
def composes_own_state?(body)
|
|
218
|
-
return false if call_with_receiver?(body.receiver)
|
|
219
|
-
|
|
220
223
|
body.arguments.any? { |argument| own_state?(argument, body.receiver) }
|
|
221
224
|
end
|
|
222
225
|
|