lib/ki.rb in ki-0.0.2 vs lib/ki.rb in ki-0.1.0
- old
+ new
@@ -1,39 +1,20 @@
require 'rack'
require 'haml'
-require 'util'
require 'db'
-require 'request'
-require 'modules'
require 'model'
-require 'controller'
-require 'response'
+require 'helpers'
+require 'util'
+require 'req'
+require 'resp'
+require 'static_file'
-Ki::Util.config_db
-Ki::Db.instance.clear_model_subclasses
+Ki::Db.instance.config_db
module Ki
class Ki
- def self.new
- Rack::Builder.new do
- Util.static_files.each do |sf|
- map "/public/#{File.basename(sf)}" do
- run Rack::File.new(sf)
- end
- end
-
- map '/' do
- run Controller.new
- end
- end
- end
-
- def self.root
- File.join(File.expand_path(File.join(File.dirname(__FILE__), '..')))
- end
-
- def self.app_name
- File.basename(Dir.getwd)
+ def call env
+ Req.new(env).serve
end
end
end