From 3aecd4831074bef5bdf4c8c432cdcfbf8d56d538 Mon Sep 17 00:00:00 2001 From: Jonas Nicklas Date: Sun, 6 Jul 2008 16:46:22 +0200 Subject: [PATCH] removed some redundant code from custom error handlers --- lib/sinatra.rb | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/sinatra.rb b/lib/sinatra.rb index b02786d..5346bac 100755 --- a/lib/sinatra.rb +++ b/lib/sinatra.rb @@ -2,9 +2,9 @@ Dir[File.dirname(__FILE__) + "/../vendor/*"].each do |l| $:.unshift "#{File.expand_path(l)}/lib" end -require 'rack' - require 'rubygems' + +require 'rack' require 'time' require 'ostruct' require "uri" @@ -198,10 +198,10 @@ module Sinatra class Error - attr_reader :code, :block + attr_reader :block - def initialize(code, &b) - @code, @block = code, b + def initialize(&b) + @block = b end def invoke(request) @@ -1087,7 +1087,7 @@ module Sinatra # The Sinatra::ServerError handler is used by default when an exception # occurs and no matching error handler is found. def error(type=ServerError, options = {}, &b) - errors[type] = Error.new(type, &b) + errors[type] = Error.new(&b) end # Define a custom error handler for '404 Not Found' responses. This is a -- 1.5.3.7