Merge pull request #7823 from Rylan12/rubocop-dstr-string-content

RuboCop string_content keep string interpolation
This commit is contained in:
Rylan Polster 2020-06-25 12:19:27 -04:00 committed by GitHub
commit 59f622d4ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -495,7 +495,15 @@ module RuboCop
when :str
node.str_content
when :dstr
node.each_child_node(:str).map(&:str_content).join
content = ""
node.each_child_node(:str, :begin) do |child|
content += if child.begin_type?
child.source
else
child.str_content
end
end
content
when :const
node.const_name
when :sym