Skip to content

Commit

Permalink
substitute: Use here document to use double quote (") in text
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 15, 2025
1 parent fe1d95a commit ecf76a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/grntest/executors/base-executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,10 @@ def execute_directive_add_substitution(line, content, options)
substituted, normalized = Shellwords.shellsplit(rest)
substituted.force_encoding("UTF-8")
normalized.force_encoding("UTF-8")
substituted_evaluator = TemplateEvaluator.new("\"#{substituted}\"")
normalized_evaluator = TemplateEvaluator.new("\"#{normalized}\"")
substituted_evaluator =
TemplateEvaluator.new("<<STRING.chomp\n#{substituted}\nSTRING")
normalized_evaluator =
TemplateEvaluator.new("<<STRING.chomp\n#{normalized}\nSTRING")
@substitutions[pattern] = [
compile_pattern(pattern),
substituted_evaluator,
Expand Down

0 comments on commit ecf76a6

Please sign in to comment.