0
- # Waves configurations are simply Ruby code, meaning you can use an Ruby expression as
0
- # a value for a configuration parameter, extend and inherit your configurations, and
0
- # add your own configuration attributes. You can even use it as a configuration repository
0
- # for your applications.
0
+ # Waves configurations are Ruby code. This means you can use a Ruby expression as
0
+ # the value of a configuration attribute, extend and inherit your configurations, and
0
+ # add your own attributes. You can even use it as a repository
0
+ # for your application configuration.
0
- # The form for configuration parameters to use the parameter name as a method name. Passing
0
- # in a parameter sets the value.
0
+ # You can access configuration attributes using the attribute name as a method, with the value as the argument.
0
@@ -25,28 +24,27 @@ module Waves
0
- # There are three forms for accessing
parameters:
0
+ # There are three forms for accessing
attributes:
0
- # Waves.config.port # generic form - gets current config
0
- # Blog.configurations[:development] # gets a value for a specific config
0
- # Blog::Configurations::Development.port # Access config constant directly
0
+ # Waves.config.port # generic form - gets the value for current config
0
+ # Blog.configurations[:development].port # gets the value for a specified config
0
+ # Blog::Configurations::Development.port # Access a specific config constant directly
0
- # You can inherit configurations, as is shown in the example above. Typically, you
0
- # can use the application's "default" configuration to set shared configurations,
0
- # and then inherit from it for specific variations.
0
+ # Configuration data is inheritable, as shown in the example above. Typically, you
0
+ # would set data common to all configurations in the Default class, from which
0
+ # your variations inherit.
0
- # To define your own attributes, and still make them inheritable, you should use
0
- # the +attribute+ class method, like this:
0
+ # You may define your own heritable attributes using the +attribute+ class method:
0
# class Default < Waves::Configurations::Default
0
- # attribute 'theme' # define a theme attribute
0
- # theme 'ultra' # give it a default
0
+ # attribute 'theme' # define an attribute named "theme"
0
+ # theme 'ultra' # set an inheritable default
0
- #
There are a number of reserved or built-in attributes. These are:
0
+ #
Certain attributes are reserved for internal use by Waves:
0
# - application: configure the application for use with Rack
0
- # - database:
takes a hash of parameters used to initalize the database; see below0
+ # - database:
initialization parameters needed by the ORM layer0
# - reloadable: an array of module names to reload; see below for more
0
# - log: takes a hash of parameters; see below for more
0
# - host: the host to bind the server to (string)
0
@@ -58,7 +56,7 @@ module Waves
0
# One of the really nice features of Rack is the ability to install "middleware"
0
# components to optimize the way you handle requests. Waves exposes this ability
0
- # directly to the application developer via the +application+ configuration
parameter.
0
+ # directly to the application developer via the +application+ configuration
method.
0
@@ -70,45 +68,45 @@ module Waves
0
# == Configuring Database Access
0
- # The database parameter takes a hash with the following elements: