lib/rubocop/cop/mixin/def_node.rb in rubocop-1.12.1 vs lib/rubocop/cop/mixin/def_node.rb in rubocop-1.13.0

- old
+ new

@@ -9,17 +9,14 @@ NON_PUBLIC_MODIFIERS = %w[private protected].freeze private def non_public?(node) - non_public_modifier?(node.parent) || - preceding_non_public_modifier?(node) + non_public_modifier?(node.parent) || preceding_non_public_modifier?(node) end def preceding_non_public_modifier?(node) - stripped_source_upto(node.first_line).any? do |line| - NON_PUBLIC_MODIFIERS.include?(line) - end + stripped_source_upto(node.first_line).any? { |line| NON_PUBLIC_MODIFIERS.include?(line) } end def stripped_source_upto(index) processed_source[0..index].map(&:strip) end