2011-11-15 21:58:27 +00:00
|
|
|
module Grack
|
|
|
|
class Handler < Base
|
|
|
|
def initialize(app, config)
|
|
|
|
@app = app
|
|
|
|
@config = config
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2011-11-17 21:57:30 +00:00
|
|
|
super
|
|
|
|
if git?
|
2011-11-20 21:58:53 +00:00
|
|
|
# TODO event_log?
|
|
|
|
project.delay.auto_build if write? # hook
|
2011-11-15 21:58:27 +00:00
|
|
|
::GitHttp::App.new(@config).call(env)
|
|
|
|
else
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|