mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ae9be13713
Fixes https://github.com/rails/rails/issues/36285. Follow up of https://github.com/rails/rails/pull/36237.
18 lines
427 B
Ruby
18 lines
427 B
Ruby
# frozen_string_literal: true
|
|
|
|
# These classes are used to strip out the ERB configuration
|
|
# values so we can evaluate the database.yml without evaluating
|
|
# the ERB values.
|
|
class DummyERB < ERB # :nodoc:
|
|
def make_compiler(trim_mode)
|
|
DummyCompiler.new trim_mode
|
|
end
|
|
end
|
|
|
|
class DummyCompiler < ERB::Compiler # :nodoc:
|
|
def compile_content(stag, out)
|
|
if stag == "<%="
|
|
out.push "_erbout << ''"
|
|
end
|
|
end
|
|
end
|