Module: Waves::Foundations::Classic

Defined in:
lib/waves/foundations/classic.rb

Overview

Provides Sun MVC features for your application. Includes ERb-style templates. You can also include others via Renderer Layers. It does NOT include a default ORM. Use an ORM Layer for that.

Class Method Summary collapse

Class Method Details

.included(app) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/waves/foundations/classic.rb', line 10

def self.included( app )

  require 'autocode'
  require 'waves/layers/mvc'
  require 'waves/layers/text/inflect/english'
  require 'waves/views/templated'
  require 'waves/layers/renderers/erubis'
  
  app.module_eval do

    include AutoCode
    
    app.auto_create_module( :Configurations ) do
      auto_create_class :Default, Waves::Configurations::Default
      auto_load :Default, :directories => [ :configurations ]
      auto_create_class true, :Default
      auto_load true, :directories => [ :configurations ]
    end

    app.auto_create_module( :Resources ) do
      auto_create_class :Default, Waves::Resources::Base
      auto_load :Default, :directories => [ :resources ]
      auto_create_class true, :Default
      auto_load true, :directories => [ :resources ]
      auto_eval :Server do
        handler( Waves::Response::ClientErrors::NotFound ) do
          app::Views::Errors.new( request ).not_found_404
        end
      end
    end

    include Waves::Layers::Text::Inflect::English
    include Waves::Layers::MVC
    include Waves::Renderers::Erubis   
    
  end
  
  Waves << app
  
end