class WebConsole::Testing::ERBPrecompiler

This class is to pre-compile ‘templates/*.erb’.

def build

def build
  @erb.result(binding)
end

def initialize(path)

def initialize(path)
  @erb  = ERB.new(File.read(path))
  @view = FakeMiddleware.new(
    view_path: Helper.gem_root.join("lib/web_console/templates"),
  ).view
end

def method_missing(name, *args, &block)

def method_missing(name, *args, &block)
  return super unless @view.respond_to?(name)
  @view.send(name, *args, &block)
end