lib/rexception.rb in rexception-0.0.1 vs lib/rexception.rb in rexception-0.1.0

- old
+ new

@@ -1,17 +1,34 @@ require 'rexception/version' -require 'rexception/controller' require 'rexception/railtie' if defined?(Rails) module Rexception - autoload :Setting, 'rexception/setting' + autoload :ExceptionsController, 'rexception/exceptions_controller' class << self - def setup(&block) - Setting.instance.setup(&block) + # Layout file name to use for rendering error page. + # + # @return [String] + attr_accessor :layout + + # Directory name where you place error pages. + # + # @return [String] + attr_accessor :errors_dir + + # Pairs of custom exceptions and statuses. + # + # @return [Hash{String => Symbol}] + def rescue_responses=(rescue_responses) + ActionDispatch::ExceptionWrapper.rescue_responses.merge!(rescue_responses) end - def setting - Setting.instance + # Configuring module attributes by initializer. + # + # @yield Rexception + def configure + yield self end end end + +require 'rexception/config'