Module: UzuUzu

Extended by:
UzuUzu
Included in:
UzuUzu
Defined in:
lib/uzuuzu-core/uzuuzu-core.rb,
lib/uzuuzu-core/tilt.rb,
lib/uzuuzu-core/helper.rb,
lib/uzuuzu-core/request.rb,
lib/uzuuzu-core/response.rb,
lib/uzuuzu-core/controller.rb,
lib/uzuuzu-core/application.rb,
lib/uzuuzu-core/helper/form.rb,
lib/uzuuzu-core/logger/file.rb,
lib/uzuuzu-core/environments.rb,
lib/uzuuzu-core/helper/route.rb,
lib/uzuuzu-core/helper/xhtml.rb,
lib/uzuuzu-core/helper/jquery.rb,
lib/uzuuzu-core/logger/stderr.rb,
lib/uzuuzu-core/logger/stdout.rb,
lib/uzuuzu-core/logger/loggers.rb,
lib/uzuuzu-core/memcache/dalli.rb,
lib/uzuuzu-core/wrapper/logger.rb,
lib/uzuuzu-core/helper/localize.rb,
lib/uzuuzu-core/helper/renderer.rb,
lib/uzuuzu-core/wrapper/wrapper.rb,
lib/uzuuzu-core/controller/index.rb,
lib/uzuuzu-core/logger/appengine.rb,
lib/uzuuzu-core/memcache/leveldb.rb,
lib/uzuuzu-core/helper/controller.rb,
lib/uzuuzu-core/memcache/appengine.rb,
lib/uzuuzu-core/memcache/memcached.rb,
lib/uzuuzu-core/rack_session/cookie.rb,
lib/uzuuzu-core/rack_session/memcache.rb,
lib/uzuuzu-core/rack_session/appengine.rb,
lib/uzuuzu-core/controller/login/twitter.rb

Defined Under Namespace

Modules: Controller, Helper, Logger, Memcache, RackSession, Tilt, Wrapper Classes: Application, Environments, Request, Response

Constant Summary collapse

Apps =
{}

Instance Method Summary collapse

Instance Method Details

#appObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 10

def app
  if Apps.blank?
    Application.new
  end
  app = {}
  Apps.each do |key, value|
    rack_session = value.environments.rack_session
    static = Rack::Static.new(value, :urls => ['/'], :root => 'public')
    if key == :uzuuzu
      app['/'] = rack_session.app(Rack::Cascade.new([static, value]))
    else
      app["/#{key}"] = rack_session.app(Rack::Cascade.new([static, value]))
    end
  end
  Rack::URLMap.new(app)
end

#appsObject



32
33
34
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 32

def apps
  Apps
end

#controllerObject



50
51
52
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 50

def controller
  Controller.current
end

#currentObject



28
29
30
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 28

def current
  Application.current
end

#helperObject



54
55
56
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 54

def helper
  Helper.current
end

#localizeObject



46
47
48
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 46

def localize
  Environments.current.localize
end

#loggerObject



37
38
39
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 37

def logger
  Environments.current.logger
end

#memcacheObject



42
43
44
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 42

def memcache
  Environments.current.memcache
end

#render_engine(instance, view_string, engine = 'erb', options = {}, locals = {}, &block) ⇒ Object



67
68
69
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 67

def render_engine(instance, view_string, engine='erb', options={}, locals={}, &block)
  Tilt.render_engine(instance, view_string, engine, options, locals, &block)
end

#requestObject



58
59
60
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 58

def request
  Request.current
end

#responseObject



62
63
64
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 62

def response
  Response.current
end