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/wrapper/dm.rb,
lib/uzuuzu-core/wrapper/s3.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/google.rb,
lib/uzuuzu-core/controller/login/twitter.rb,
lib/uzuuzu-core/controller/login/facebook.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



60
61
62
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 60

def controller
  Controller.current
end

#currentObject



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

def current
  Application.current
end

#dmObject



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

def dm
  Environments.current.dm
end

#helperObject



64
65
66
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 64

def helper
  Helper.current
end

#localizeObject



56
57
58
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 56

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



52
53
54
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 52

def memcache
  Environments.current.memcache
end

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



77
78
79
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 77

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

#requestObject



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

def request
  Request.current
end

#responseObject



72
73
74
# File 'lib/uzuuzu-core/uzuuzu-core.rb', line 72

def response
  Response.current
end

#s3Object



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

def s3
  Environments.current.s3
end