[Hiki-cvs 1445] [993] add missing file

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 24日 (月) 00:01:57 JST


Revision: 993
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=993
Author:   okkez
Date:     2009-08-24 00:01:57 +0900 (Mon, 24 Aug 2009)

Log Message:
-----------
add missing file

Added Paths:
-----------
    hiki/branches/rack/hiki/app.rb

Added: hiki/branches/rack/hiki/app.rb
===================================================================
--- hiki/branches/rack/hiki/app.rb	                        (rev 0)
+++ hiki/branches/rack/hiki/app.rb	2009-08-23 15:01:57 UTC (rev 993)
@@ -0,0 +1,28 @@
+
+require 'rubygems'
+require 'rack'
+
+require 'hiki/config'
+
+$LOAD_PATH.unshift 'hiki'
+
+module Hiki
+  class App
+    def call(env)
+      request = Rack::Request.new(env)
+      # TODO use Rack::Request#env or other methods instead of ENV
+      conf = Hiki::Config.new
+      db = conf.database
+      response = nil
+      db.open_db do
+        command = Hiki::Command.new(request, db, conf)
+        response = command.dispatch
+      end
+      # [body, status, headers]
+      # Rack::Response.new(*response){|r|
+      # }.finish
+      response.header.delete('status')
+      response.finish
+    end
+  end
+end




Hiki-cvs メーリングリストの案内
Back to archive index