summaryrefslogtreecommitdiff
path: root/sample/ripper/ruby2html.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/ripper/ruby2html.rb')
-rw-r--r--sample/ripper/ruby2html.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/sample/ripper/ruby2html.rb b/sample/ripper/ruby2html.rb
index 8f64f5a..1e6b3bf 100644
--- a/sample/ripper/ruby2html.rb
+++ b/sample/ripper/ruby2html.rb
@@ -73,7 +73,11 @@ class ERB
end
def ruby2html(f, encoding, css, print_line_number)
- erb = ERB.new(TEMPLATE, nil, '>')
+ if RUBY_VERSION >= '2.6'
+ erb = ERB.new(TEMPLATE, trim_mode: '>')
+ else
+ erb = ERB.new(TEMPLATE, nil, '>')
+ end
erb.filename = __FILE__
erb.lineno = TEMPLATE_LINE
erb.result(binding())