Skip to content

Commit

Permalink
Try new config.ru of doom
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Sep 8, 2009
1 parent cb18ce3 commit 2a0f28e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions config.ru
@@ -1,5 +1,24 @@
vendor_dir = File.join(File.dirname(__FILE__), "vendor")

require File.join(vendor_dir, "rack", "lib", "rack")
require File.join(vendor_dir, "sinatra", "lib", "sinatra")

Sinatra::Application.default_options.merge!(
:root => GitAuth::BASE_DIR,
:views => GitAuth::BASE_DIR.join("views"),
:public => GitAuth::BASE_DIR.join("public"),
:run => false,
:env => :production
)

require File.join(File.dirname(__FILE__), "lib", "gitauth")
require GitAuth::BASE_DIR.join("lib", "gitauth", "web_app")

GitAuth::Settings.setup!

output = File.open(GitAuth::Logger.default_logger_path, "a+")

STDOUT.reopen(output)
STDERR.reopen(output)

run GitAuth::WebApp.new
3 changes: 2 additions & 1 deletion lib/gitauth.rb
Expand Up @@ -55,8 +55,9 @@ def self.require_vendored(lib)
Settings.default_settings_path = GITAUTH_DIR.join("settings.yml")
Settings.lookup_key_path = []
Logger.default_logger_path = GITAUTH_DIR.join("gitauth.log")
l.before_run { GitAuth.each_model(:load!) }
# Register stuff on the loader.
l.register_controller :web_app, 'GitAuth::WebApp'
l.before_run { GitAuth.prepare }
end

class << self
Expand Down
2 changes: 2 additions & 0 deletions lib/gitauth/saveable_class.rb
Expand Up @@ -21,6 +21,7 @@ module GitAuth
class BasicSaveable

class_inheritable_accessor :all, :store_path
self.all = nilin

class << self

Expand Down Expand Up @@ -49,4 +50,5 @@ def self.SaveableClass(kind)
klass.all = nil
return klass
end

end

0 comments on commit 2a0f28e

Please sign in to comment.