summaryrefslogtreecommitdiff
path: root/lib/highline/statement.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/highline/statement.rb')
-rw-r--r--lib/highline/statement.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/highline/statement.rb b/lib/highline/statement.rb
index 35d7961..6f14868 100644
--- a/lib/highline/statement.rb
+++ b/lib/highline/statement.rb
@@ -78,7 +78,11 @@ class HighLine
end
def template
- @template ||= ERB.new(template_string, nil, "%")
+ @template ||= if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
+ ERB.new(template_string, trim_mode: "%")
+ else
+ ERB.new(template_string, nil, "%")
+ end
end
end
end