2012-01-14 21:18:39 +01:00
|
|
|
# Support rack/showexceptions during development
|
2011-12-09 20:11:17 +01:00
|
|
|
module Middleman::CoreExtensions::ShowExceptions
|
2012-01-14 21:18:39 +01:00
|
|
|
|
|
|
|
# Setup extension
|
2011-12-09 20:11:17 +01:00
|
|
|
class << self
|
2012-01-14 21:18:39 +01:00
|
|
|
|
|
|
|
# Once registered
|
2011-12-09 20:11:17 +01:00
|
|
|
def registered(app)
|
2012-01-14 21:18:39 +01:00
|
|
|
# Require lib
|
|
|
|
require 'rack/showexceptions'
|
|
|
|
|
|
|
|
# When in dev
|
2011-12-12 00:49:13 +01:00
|
|
|
app.configure :development do
|
2012-01-14 21:18:39 +01:00
|
|
|
# Include middlemare
|
2011-12-09 20:11:17 +01:00
|
|
|
if show_exceptions
|
|
|
|
use ::Middleman::CoreExtensions::ShowExceptions::Middleware
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-01-14 21:18:39 +01:00
|
|
|
# Custom exception class
|
|
|
|
# TODO: Style this ourselves
|
2011-12-09 20:11:17 +01:00
|
|
|
class Middleware < ::Rack::ShowExceptions
|
|
|
|
end
|
2012-01-14 21:18:39 +01:00
|
|
|
end
|