allow non-bundled tilt to be loaded

Tries to require 'tilt' before falling back on the
bundled version - 'sinatra/tilt'. This should result
in any tilt on the $LOAD_PATH overriding the bundled
version.
This commit is contained in:
Ryan Tomayko 2009-10-16 22:01:55 -07:00
parent 5d228993e3
commit c4263e2945
2 changed files with 7 additions and 1 deletions

View File

@ -3,9 +3,15 @@ require 'time'
require 'uri'
require 'rack'
require 'rack/builder'
require 'tilt'
require 'sinatra/showexceptions'
# require tilt if available; fall back on bundled version.
begin
require 'tilt'
rescue LoadError
require 'sinatra/tilt'
end
module Sinatra
VERSION = '0.10.1'