2017-11-27 13:45:24 +03:00
|
|
|
# frozen_string_literal: true
|
2012-11-27 08:28:14 +04:00
|
|
|
##
|
|
|
|
# Allows an ERB template to be rendered in the context (binding) of an
|
|
|
|
# existing ERB template evaluation.
|
|
|
|
|
|
|
|
class RDoc::ERBPartial < ERB
|
|
|
|
|
|
|
|
##
|
|
|
|
# Overrides +compiler+ startup to set the +eoutvar+ to an empty string only
|
|
|
|
# if it isn't already set.
|
|
|
|
|
|
|
|
def set_eoutvar compiler, eoutvar = '_erbout'
|
|
|
|
super
|
|
|
|
|
2019-02-16 16:48:51 +03:00
|
|
|
compiler.pre_cmd = ["#{eoutvar} ||= +''"]
|
2012-11-27 08:28:14 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|