module Erector

todo: unit test

Erector view framework

Constants

HtmlWidget

Alias to make it easier to spell

VERSION
XmlWidget

Public Class Methods

init_rails(binding) click to toggle source
# File lib/erector/rails2.rb, line 11
def self.init_rails(binding)
  # Rails defaults do not include app/views in the eager load path.
  # It needs to be there, because erector views are .rb files.
  if config = eval("config if defined? config", binding)
    view_path = config.view_path
    config.load_paths       << view_path unless config.load_paths.include?(view_path)
    config.eager_load_paths << view_path unless config.eager_load_paths.include?(view_path)

    # Rails probably already ran Initializer#set_load_path and
    # #set_autoload_paths by the time we got here.
    $LOAD_PATH.unshift(view_path) unless $LOAD_PATH.include?(view_path)
    unless ActiveSupport::Dependencies.load_paths.include?(view_path)
      ActiveSupport::Dependencies.load_paths << view_path
    end
  end
end
inline(*args, &block) click to toggle source
# File lib/erector/inline.rb, line 2
def self.inline(*args, &block)
  InlineWidget.new(*args, &block)
end