middleman/middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb
2012-05-07 14:41:39 -07:00

31 lines
672 B
Ruby

# Require lib
require 'rack/showexceptions'
# Support rack/showexceptions during development
module Middleman
module CoreExtensions
module ShowExceptions
# Setup extension
class << self
# Once registered
def registered(app)
# When in dev
app.configure :development do
# Include middlemare
if show_exceptions
use ::Middleman::CoreExtensions::ShowExceptions::Middleware
end
end
end
end
# Custom exception class
# TODO: Style this ourselves
class Middleware < ::Rack::ShowExceptions
end
end
end
end