Class: Waves::Configurations::Default
- Defined in:
- lib/runtime/configuration.rb
Overview
The Default configuration defines sensible defaults for attributes required by Waves.
debug true
synchronize? true
session :duration => 30.minutes, :path => '/tmp/sessions'
log :level => :info, :output => $stderr
reloadable []
Class Method Summary collapse
-
.application(&block) ⇒ Object
Defines the application for use with Rack.
-
.handler(*args) ⇒ Object
Set the Rack handler, along with any specific options that need to be passed to the handler’s #run method.
-
.mime_types ⇒ Object
Provides access to the Waves::MimeTypes class via the configuration.
Methods inherited from Base
Class Method Details
.application(&block) ⇒ Object
Defines the application for use with Rack. Treat this method like an instance of Rack::Builder
169 170 171 172 173 174 175 |
# File 'lib/runtime/configuration.rb', line 169 def self.application( &block ) if block_given? self['application'] = Rack::Builder.new( &block ) else self['application'] end end |
.handler(*args) ⇒ Object
Set the Rack handler, along with any specific options that need to be passed to the handler’s #run method.
When accessing the value (calling with no arguments), returns an array of the handler and options.
153 154 155 156 157 158 159 |
# File 'lib/runtime/configuration.rb', line 153 def self.handler(*args) if args.length > 0 @rack_handler, = args else [ @rack_handler, ] end end |
.mime_types ⇒ Object
Provides access to the Waves::MimeTypes class via the configuration. You can override #mime_types to return your own MIME types repository class.
163 164 165 |
# File 'lib/runtime/configuration.rb', line 163 def self.mime_types Waves::MimeTypes end |