lib/foreman/export/base.rb in foreman-0.84.0 vs lib/foreman/export/base.rb in foreman-0.85.0

- old
+ new

@@ -133,10 +133,14 @@ File.read(matchers.detect { |m| File.exists?(m) }) end end def write_template(name, target, binding) - compiled = ERB.new(export_template(name), nil, '-').result(binding) + compiled = if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+ + ERB.new(export_template(name), trim_mode: '-').result(binding) + else + ERB.new(export_template(name), nil, '-').result(binding) + end write_file target, compiled end def chmod(mode, file) say "setting #{file} to mode #{mode}"