Class: Waves::Configurations::Default

Inherits:
Base show all
Defined in:
lib/waves/runtime/configuration.rb

Overview

The Default configuration defines sensible defaults for attributes required by Waves.

Class Method Summary collapse

Methods inherited from Base

[], []=, attribute, attributes

Class Method Details

.application(&block) ⇒ Object

Defines the application for use with Rack. Treat this method like an instance of Rack::Builder



83
84
85
86
87
88
89
# File 'lib/waves/runtime/configuration.rb', line 83

def self.application( &block )
  if block_given?
    self['application'] = Rack::Builder.new( &block )
  else
    self['application'] ||= Rack::Builder.new
  end
end

.dependencies(list) ⇒ Object

are there any gems we need to check for on startup?



68
69
70
71
72
73
# File 'lib/waves/runtime/configuration.rb', line 68

def self.dependencies( list )
  list.each do |d| 
    gem d[:name], d[:version]
    require d[:load] if d[:load]
  end
end

.mime_typesObject

Provides access to the Waves::MimeTypes class via the configuration. You can override #mime_types to return your own MIME types repository class.



77
78
79
# File 'lib/waves/runtime/configuration.rb', line 77

def self.mime_types
  Waves::MimeTypes
end

.use(middleware, options) ⇒ Object



91
92
93
# File 'lib/waves/runtime/configuration.rb', line 91

def self.use( middleware, options )
  application.use( middleware, options )
end