From 22efdcfa44d0a13bd33ff475563ffd91c5d862a8 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 27 Jun 2011 12:33:21 -0700 Subject: [PATCH] re-raise missing template exception in dev --- lib/middleman/builder.rb | 6 ++---- lib/middleman/server.rb | 8 ++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/middleman/builder.rb b/lib/middleman/builder.rb index af8ddbcc..600530f2 100644 --- a/lib/middleman/builder.rb +++ b/lib/middleman/builder.rb @@ -85,10 +85,8 @@ module Middleman lookup = File.join(lookup, '*') results = Dir[lookup].sort do |a, b| - simple_a = a.gsub(Middleman::Server.root + "/", '') - .gsub(Middleman::Server.views + "/", '') - simple_b = b.gsub(Middleman::Server.root + "/", '') - .gsub(Middleman::Server.views + "/", '') + simple_a = a.gsub(Middleman::Server.root + "/", '').gsub(Middleman::Server.views + "/", '') + simple_b = b.gsub(Middleman::Server.root + "/", '').gsub(Middleman::Server.views + "/", '') a_dir = simple_a.split("/").first b_dir = simple_b.split("/").first diff --git a/lib/middleman/server.rb b/lib/middleman/server.rb index 590460fe..c64b3cb9 100644 --- a/lib/middleman/server.rb +++ b/lib/middleman/server.rb @@ -186,8 +186,12 @@ module Middleman status 404 rescue Padrino::Rendering::TemplateNotFound - $stderr.puts "File not found: #{request.path}" - status 404 + if settings.environment == :development + raise $! + else + $stderr.puts "File not found: #{request.path}" + status 404 + end end end end