diff options
Diffstat (limited to 'railties/lib/rails/application/dummy_erb_compiler.rb')
-rw-r--r-- | railties/lib/rails/application/dummy_erb_compiler.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/lib/rails/application/dummy_erb_compiler.rb b/railties/lib/rails/application/dummy_erb_compiler.rb new file mode 100644 index 0000000000..4e92526969 --- /dev/null +++ b/railties/lib/rails/application/dummy_erb_compiler.rb @@ -0,0 +1,16 @@ +# 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) + out.push "_erbout << 'dummy_compiler'" + end +end |