Reference RuboCop issue.

This commit is contained in:
Markus Reiter 2018-07-01 18:45:52 +02:00
parent 71a79e7e04
commit 9d79cf1e9d

View File

@ -110,7 +110,10 @@ module Formatter
end
def comma_and(*items)
*items, last = items.map(&:to_s) # rubocop:disable Lint/ShadowedArgument, TODO: Remove when RuboCop 0.57.3 is released.
# TODO: Remove when RuboCop 0.57.3 is released.
# False positive has been fixed and merged, but is not yet in a
# stable release: https://github.com/rubocop-hq/rubocop/pull/6038
*items, last = items.map(&:to_s) # rubocop:disable Lint/ShadowedArgument
return last if items.empty?
"#{items.join(", ")} and #{last}"