Module: Zena::App

Included in:
ApplicationController
Defined in:
lib/zena/app.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/zena/app.rb', line 30

def self.included(base)
  base.prepend_view_path SITES_ROOT
  base.class_eval do
    bricks = []
    Zena::Use.each_module_for('Controller') do |mod|
      if mod.to_s =~ /^Bricks::/
        bricks << mod
      else
        include mod
      end
    end

    bricks.each do |mod|
      include mod
    end

    include RubyLess

    helper  Zena::Acts::Secure

    Zena::Use.each_module_for('View') do |mod|
      helper mod
    end

    helper_method :render_to_string
  end
  Bricks.apply_patches('application_controller.rb')
  Bricks.apply_patches('application_helper.rb')

  ::User.class_eval do
    Zena::Use.each_module_for('User') do |mod|
      include mod
    end
  end

  ::Site.class_eval do
    Zena::Use.each_module_for('Site') do |mod|
      include mod
    end
  end
  
  ::Skin.class_eval do
    Zena::Use.each_module_for('Skin') do |mod|
      include mod
    end
  end
end