Sha256: 63d5d1458fe8100c26299b0064ed3199e3ba169dfeed34c8435239091bb4699f

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

# coding: utf-8

#
#
#
module UzuUzu
  Apps = {}
  
  #
  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
  
  #
  def current
    Application.current
  end
  
  def apps
    Apps
  end
  
  #
  def logger
    Environments.current.logger
  end

  #
  def memcache
    Environments.current.memcache
  end

  def localize
    Environments.current.localize
  end
  
  def controller
    Controller.current
  end

  def helper
    Helper.current
  end
  
  def request
    Request.current
  end
  
  def response
    Response.current
  end
  
  #
  def render_engine(instance, view_string, engine='erb', options={}, locals={}, &block)
    Tilt.render_engine(instance, view_string, engine, options, locals, &block)
  end
  
  extend self
end # UzuUzu

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
uzuuzu-core-0.1.10 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.8 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.7 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.6 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.5 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.4 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.3 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.2.001 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.2 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.1 lib/uzuuzu-core/uzuuzu-core.rb
uzuuzu-core-0.1.0 lib/uzuuzu-core/uzuuzu-core.rb