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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ae1550d29e9e7aeb18b9f63d2e8f167ef5a7d871f2e953551e7be6c86038430
4
- data.tar.gz: fba303001375952d8f8f1e3de021a9a5b155adc79440bb526342391c81be2a9b
3
+ metadata.gz: b77d2e545ac1a1e5b85a636130c793c0268ff8740636b7a8a99e419d1991477d
4
+ data.tar.gz: df0ee08ada7246f370bb32da744ea1d2482fb196eb103de0ea2546ad433517aa
5
5
  SHA512:
6
- metadata.gz: a32371dd923b0922ae7072b11d6917cf876eec46061a3fe0a7229a5bac2713d77b66f75ef7259f15838173d20dbd7f039dcb4af0ce0c456216091906eda7f6c4
7
- data.tar.gz: a5cece615fd407987d77a5e7d5db08ef78c816a07c3330da17fdd5d778552dfd4ff1d249d044b95540ce06a04b873623853b42a5e466bbe4d389fb284784f75a
6
+ metadata.gz: b1eaf0aea17f94ec3cdada0afc664724104d3da9abf190ea11ada7db715f39175bbc3471046af08dfc71fa5fe6841a8678becd8d9b4b85d9f2f3a071af491ed0
7
+ data.tar.gz: 5c2419f1ea701a95478a872c57f40e0a8af77cdf85f2ae154f4e75ae7a0e1981d7da7fe0d57152a20ee96937f4cdb7f2aff2c431a94ea1fb222203891d74ce69
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevencop (0.26.1)
4
+ sevencop (0.26.2)
5
5
  activesupport
6
6
  rubocop
7
7
 
@@ -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.operator_method?
754
+ receiver_source = "(#{receiver_source})" if enclose_by_parentheses?(receiver)
747
755
  [receiver_source, method].join('.')
748
756
  end
749
757
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.26.1'
4
+ VERSION = '0.26.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevencop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura