lib/rubocop/cop/style/align_hash.rb in rubocop-0.27.1 vs lib/rubocop/cop/style/align_hash.rb in rubocop-0.28.0
- old
+ new
@@ -30,11 +30,11 @@
# Common functionality for the styles where not only keys, but also
# values are aligned.
class AlignmentOfValues
def checkable_layout(node)
- !any_pairs_on_the_same_line?(node) && all_have_same_sparator?(node)
+ !any_pairs_on_the_same_line?(node) && all_have_same_separator?(node)
end
def deltas(first_pair, _prev_pair, current_pair)
key_delta = key_delta(first_pair, current_pair)
current_separator = current_pair.loc.operator
@@ -62,10 +62,10 @@
key.loc.line
end
lines_of_the_children.uniq.size < lines_of_the_children.size
end
- def all_have_same_sparator?(node)
+ def all_have_same_separator?(node)
first_separator = node.children.first.loc.operator.source
node.children[1..-1].all? do |pair|
pair.loc.operator.is?(first_separator)
end
end