Sinatra::Delegators is getting mixed in to Object, which forces in Object#get, Object#before, etc. This messes up method_missing stuff and is just generally a bad idea. This patch seems to keep all tests passing and makes sure that the delegators are only included in the actual Sinatra classes.
Including Delegators only in Sinatra classes
Hi there, thanks for the pull request!
I can't merge this in though. This would break most Sinatra applications. We intentionally include it in Object. Otherwise classic style applications won't work. Example:
get '/' do
"with your patch, it would raise a NameError"
This is why we do this when you require "sinatra" but not when you require "sinatra/base". See Modular vs. Classic Style. I will add a test that will fail with your patch.
The issue with method_missing only occurs with sloppily implemented delegation. If you define method_missing you should also define respond_to?, which Sinatra will honor.