support for modular applications

This commit is contained in:
John Bintz 2011-07-21 21:09:30 -04:00
parent 996f56b5e7
commit 66030d73c5
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ module Sinatra
end
def source_url_timestamp(url)
full_url = "#{Sinatra::Application.root}/public#{url}"
full_url = "#{settings.root}/public#{url}"
if File.exists? full_url
timestamp = File.mtime(full_url).to_i
"#{url}?#{timestamp}"

View File

@ -57,7 +57,7 @@ EOD
end
def test_tags_returns_time_stamp_when_file_exists
file_path = "#{Sinatra::Application.root}/public/bar/javascripts/summer.js"
file_path = "#{app.settings.root}/public/bar/javascripts/summer.js"
File.expects(:"exists?").with(file_path).returns(true)
File.expects(:mtime).with(file_path).returns(123456789)