Minor tweaks to use_in_file_templates! auto loading

1. Don't add the sinatra lib dir to $: on each reload.
2. Don't remove sinatra.rb from $LOADED_FEATURES unless we're
   reloading.
This commit is contained in:
Ryan Tomayko 2009-01-16 18:45:22 -08:00
parent eec7d21416
commit 0324732179
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,6 @@
$LOAD_PATH.unshift File.dirname(__FILE__)
libdir = File.dirname(__FILE__)
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
require 'sinatra/base'
require 'sinatra/main'
require 'sinatra/compat'

View File

@ -796,7 +796,6 @@ module Sinatra
end
def self.call(env)
$LOADED_FEATURES.delete("sinatra.rb")
reload! if reload?
super
end
@ -804,6 +803,7 @@ module Sinatra
def self.reload!
@reloading = true
superclass.send :inherited, self
$LOADED_FEATURES.delete("sinatra.rb")
::Kernel.load app_file
@reloading = false
end