From cb187f6846cb3cb81c989cd5f74aada3e60bbec9 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Wed, 24 Jun 2020 22:00:46 -0400 Subject: [PATCH] RuboCop string_content keep string interpolation --- Library/Homebrew/rubocops/extend/formula.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/rubocops/extend/formula.rb b/Library/Homebrew/rubocops/extend/formula.rb index 81281cd63a..34b8a4a7f1 100644 --- a/Library/Homebrew/rubocops/extend/formula.rb +++ b/Library/Homebrew/rubocops/extend/formula.rb @@ -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