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