Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit fafbed5

Browse files
authored
Merge pull request #2525 from koic/deprecate_safe_level_of_erb_new_in_ruby_2_6
Deprecate safe_level of `ERB.new` in Ruby 2.6
2 parents b8225ba + c1b5695 commit fafbed5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rspec/core/configuration_options.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ def args_from_options_file(path)
168168
end
169169

170170
def options_file_as_erb_string(path)
171-
ERB.new(File.read(path), nil, '-').result(binding)
171+
# FIXME: Consider removing the following conditional branch after Ruby 2.6 is released.
172+
# https://github.com/ruby/ruby/commit/cc777d09f44fa909a336ba14f3aa802ffe16e010
173+
if RUBY_VERSION >= '2.6'
174+
ERB.new(File.read(path), :trim_mode => '-').result(binding)
175+
else
176+
ERB.new(File.read(path), nil, '-').result(binding)
177+
end
172178
end
173179

174180
def custom_options_file

0 commit comments

Comments
 (0)