todo: unit test
Erector view framework
Alias to make it easier to spell
# 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
# File lib/erector/inline.rb, line 2 def self.inline(*args, &block) InlineWidget.new(*args, &block) end