diff --git a/Gemfile b/Gemfile index d10c8c8..2e2a5ee 100644 --- a/Gemfile +++ b/Gemfile @@ -30,4 +30,4 @@ group :test do gem "rspec", "~> 2.13.0" end -gem 'sinatra', '~> 1.3.3' +gem 'sinatra', '~> 1.4.2' diff --git a/Gemfile.lock b/Gemfile.lock index bdab89c..1c5bf89 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,10 +88,10 @@ GEM sass (3.2.7) sass-globbing (1.0.0) sass (>= 3.1) - sinatra (1.3.6) - rack (~> 1.4) - rack-protection (~> 1.3) - tilt (~> 1.3, >= 1.3.3) + sinatra (1.4.2) + rack (~> 1.5, >= 1.5.2) + rack-protection (~> 1.4) + tilt (~> 1.3, >= 1.3.4) slop (3.4.4) stitch-rb (0.0.8) stringex (1.4.0) @@ -126,7 +126,7 @@ DEPENDENCIES rspec (~> 2.13.0) rubypants (~> 0.2.0) sass-globbing (~> 1.0.0) - sinatra (~> 1.3.3) + sinatra (~> 1.4.2) stitch-rb stringex (~> 1.4.0) tzinfo (~> 0.3.35) diff --git a/config.ru b/config.ru index c444156..8e3dc08 100644 --- a/config.ru +++ b/config.ru @@ -7,11 +7,11 @@ $root = ::File.dirname(__FILE__) class SinatraStaticServer < Sinatra::Base get(/.+/) do - send_sinatra_file(unescape request.path) {404} + send_sinatra_file(request.path) {404} end not_found do - send_sinatra_file('404.html') {"Sorry, I cannot find #{request.path}"} + send_file(File.join(File.dirname(__FILE__), 'public', '404.html'), {:status => 404}) end def send_sinatra_file(path, &missing_file_block)