diff --git a/README.rdoc b/README.rdoc index 05e49d28..49c4c34f 100644 --- a/README.rdoc +++ b/README.rdoc @@ -922,7 +922,20 @@ The request.body is an IO or StringIO object: Run once, at startup, in any environment: configure do - ... + # setting one option + set :option, 'value' + + # setting multiple options + set :a => 1, :b => 2 + + # same as `set :option, true` + enable :option + + # same as `set :option, false` + disable :option + + # you can also have dynamic settings with blocks + set(:css_dir) { File.join(views, 'css') } end Run only when the environment (RACK_ENV environment variable) is set to @@ -939,6 +952,18 @@ Run when the environment is set to either :production or ... end +You can access those options via settings: + + configure do + set :foo, 'bar' + end + + get '/' do + settings.foo? # => true + settings.foo # => 'bar' + ... + end + == Error Handling Error handlers run within the same context as routes and before filters, which