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:
parent
eec7d21416
commit
0324732179
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue