Fix cop for interpolated strings.

This commit is contained in:
Markus Reiter 2019-10-16 19:06:39 +02:00
parent 3d0fae4621
commit 6cff8aff90

View File

@ -15,7 +15,13 @@ module RuboCop
def on_homepage_stanza(stanza)
url_node = stanza.stanza_node.first_argument
url = url_node.str_content
url = if url_node.dstr_type?
# Remove quotes from interpolated string.
url_node.source[1..-2]
else
url_node.str_content
end
return unless url&.match?(%r{^.+://[^/]+$})