Fix cop for interpolated strings.
This commit is contained in:
parent
3d0fae4621
commit
6cff8aff90
@ -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{^.+://[^/]+$})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user