middleman/middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb

31 lines
672 B
Ruby
Raw Normal View History

# Require lib
require 'rack/showexceptions'
2012-01-14 21:18:39 +01:00
# Support rack/showexceptions during development
module Middleman
module CoreExtensions
module ShowExceptions
2012-01-14 21:18:39 +01:00
# Setup extension
class << self
2012-01-14 21:18:39 +01: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
end
end
# Custom exception class
# TODO: Style this ourselves
class Middleware < ::Rack::ShowExceptions
end
end
end
2012-01-14 21:18:39 +01:00
end