Chapter 12. Configuration

Config directives are set using Web::config[:directive] = value. If desired, config directives can be set within 'site_lib/x.x/web/site-config.rb'.

Below is a list of available config directives:

:load_suffix

:load_suffix contains a hash of handlers for different file extensions. You can then control the behavior of Web::load:

Web::config[:load_suffix][:amrita] = lambda do |scriptname|
  #...handle amrita templates...
end

:load_suffix by default will load .rb and .erb files appropriately. Everything else is loaded using ruby-web's default templating.

:load_path
:load_path is an array of directories, searched by Web::load when it has been given a relative path to load.
:error_style
Controls how exceptions are handled. Valid values include :development, :production, or :custom. :development prints a full stacktrace, :production prints a more abbreviated message. :custom allows one to defined their own handler using Web::config[:error_handler]
:multipart_progress_hook
Allows one to pass a lambda that will be called as a multipart upload is read. The lambda is called with 2 arguments: the total number of bytes, and the number of bytes read so far. Probably only useful to AJAX implementations.