sevencop 0.26.1 → 0.26.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rubocop/cop/sevencop/rails_date_and_time_calculation.rb +9 -1
- data/lib/sevencop/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: b77d2e545ac1a1e5b85a636130c793c0268ff8740636b7a8a99e419d1991477d
|
4
|
+
data.tar.gz: df0ee08ada7246f370bb32da744ea1d2482fb196eb103de0ea2546ad433517aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1eaf0aea17f94ec3cdada0afc664724104d3da9abf190ea11ada7db715f39175bbc3471046af08dfc71fa5fe6841a8678becd8d9b4b85d9f2f3a071af491ed0
|
7
|
+
data.tar.gz: 5c2419f1ea701a95478a872c57f40e0a8af77cdf85f2ae154f4e75ae7a0e1981d7da7fe0d57152a20ee96937f4cdb7f2aff2c431a94ea1fb222203891d74ce69
|
data/Gemfile.lock
CHANGED
@@ -700,6 +700,14 @@ module RuboCop
|
|
700
700
|
end
|
701
701
|
end
|
702
702
|
|
703
|
+
# Determine whether this node should be enclosed in parentheses
|
704
|
+
# when it is used as a receiver of a method call in autocorrection.
|
705
|
+
# @param node [RuboCop::AST::Node]
|
706
|
+
# @return [Boolean]
|
707
|
+
def enclose_by_parentheses?(node)
|
708
|
+
node.send_type? && node.operator_method?
|
709
|
+
end
|
710
|
+
|
703
711
|
# @param node [RuboCop::AST::SendNode]
|
704
712
|
# @param method_name [Symbol]
|
705
713
|
# @return [Boolean]
|
@@ -743,7 +751,7 @@ module RuboCop
|
|
743
751
|
receiver:
|
744
752
|
)
|
745
753
|
receiver_source = receiver.source
|
746
|
-
receiver_source = "(#{receiver_source})" if receiver
|
754
|
+
receiver_source = "(#{receiver_source})" if enclose_by_parentheses?(receiver)
|
747
755
|
[receiver_source, method].join('.')
|
748
756
|
end
|
749
757
|
|
data/lib/sevencop/version.rb
CHANGED