Permalink
Browse files

test

  • Loading branch information...
1 parent bd56268 commit 094ce58db8eb4192b2b09937feda9adf56f69810 bry4n committed Nov 22, 2009
Showing with 15 additions and 10 deletions.
  1. +13 −9 app.rb
  2. +2 −1 config.ru
View
22 app.rb
@@ -1,7 +1,7 @@
require "yaml"
-config = YAML.load_file("configs/config.yml")
-if config["logging"] == true
+$config = YAML.load_file("configs/config.yml")
+if $config["logging"] == true
log = File.new('log/sinatra.log', 'a+')
$stderr.reopen(log)
end
@@ -10,14 +10,16 @@
require 'sinatra'
require 'configs/deps'
-set :environment, :"#{config['environment']}"
-set :server, config["server"]
-set :host, config["host"]
-set :port, config["port"].to_i
-set :views, 'app/views'
-set :public, 'public'
+set :run, false
-enable :sessions, :logging, :dump_errors, :raise_errors, :static
+class MVC < Sinatra::Base
+ set :environment, :"#{$config['environment']}"
+ set :server, $config["server"]
+ set :host, $config["host"]
+ set :port, $config["port"].to_i
+ set :views, 'app/views'
+ set :public, 'public'
+ enable :sessions, :logging, :dump_errors, :raise_errors, :static
load 'configs/configures.rb'
@@ -26,3 +28,5 @@
Dir.glob("helpers/*.rb") {|file| load file}
load "configs/routes.rb"
+
+end
View
@@ -2,4 +2,5 @@ require 'app'
use Rack::ShowExceptions
-run Sinatra::Application
+puts $config
+MVC.run! $config

0 comments on commit 094ce58

Please sign in to comment.