Class: Thor::Actions::CapturableERB

Inherits:
ERB
  • Object
show all
Defined in:
lib/thor/actions/file_manipulation.rb

Overview

Thor::Actions#capture depends on what kind of buffer is used in ERB. Thus CapturableERB fixes ERB to use String buffer.

Instance Method Summary collapse

Instance Method Details

#set_eoutvar(compiler, eoutvar = "_erbout") ⇒ Object



363
364
365
366
367
368
# File 'lib/thor/actions/file_manipulation.rb', line 363

def set_eoutvar(compiler, eoutvar = "_erbout")
  compiler.put_cmd = "#{eoutvar}.concat"
  compiler.insert_cmd = "#{eoutvar}.concat"
  compiler.pre_cmd = ["#{eoutvar} = ''.dup"]
  compiler.post_cmd = [eoutvar]
end