0
+# Start w/ thin start -r invisible.rb
0
+ @template = Tenjin::Engine.new(:postfix=>'.rbhtml', :layout=>'../layout.rbhtml', :path=>'home')
0
+ @file = Rack::File.new('public')
0
+ path = env['PATH_INFO']
0
+ _, controller, action = env['PATH_INFO'].split('/')
0
+ Invisible.const_get("#{(controller || 'home').capitalize}Controller").new(@template, env).call(action || 'index')
0
+ def initialize(template, env)
0
+ @template, @status, @env, @headers = template, 200, env, {'Content-Type' => 'text/html'}
0
+ render(action) unless @body
0
+ [@status, @headers.merge('Content-Length'=>@body.size.to_s), [@body]]
0
+ def render(action=nil)
0
+ @body = @template.render(action.to_sym, instance_variables.inject({}) {|h,v| h[v[1..-1]] = instance_variable_get(v); h})
0
+require 'app/controllers'
0
+run Invisible::Adapter.new
0
\ No newline at end of file
Comments
No one has commented yet.