sinatra/sinatra-contrib — pull request #133 by bjeanes (2014-05-09 06:47:47+00:00)
Title: Only require the parts of backports that are actually used

Relates to #105.

It partially addresses the original concern there (and others) by reducing the number of monkey patches implicitly required into the runtime of projects using sinatra-contrib.

In #105, @zzak said:

> I would welcome a patch to remove the dependency on backports as long as we don't actually break backwards compatibility.

This is a step in that direction. It removes all `require "backports"` and replaces them with requires to explicit modules in the backports gem that provide just the functionality that is relied upon (as judged by passing tests in 1.8.7). If one wished to remove the dependency entirely, the surface area for work to do is now smaller. There are also some low-hanging items that could safely be changed to no longer require backports (e.g. `{}.key(:value)` -> `{}.index(:value)`).