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

Deprecate safe_level of ERB.new in Ruby 2.6 #2525

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/rspec/core/configuration_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ def args_from_options_file(path)
end

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

def custom_options_file
Expand Down