Remove Tilt mappings for missing libraries. Fixes #713

i18n_v4
Thomas Reynolds 2013-01-08 10:22:52 -08:00
parent 84239f04a2
commit eccda125e5
7 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,20 @@
Feature: Tilt missing support libraries
Scenario: Rendering Textile and Wiki files
Given the Server is running at "missing-tilt-library-app"
When I go to "/danger-zone/more-wiki.html.wiki"
Then I should see "File Not Found"
When I go to "/danger-zone/more-wiki.html"
Then I should see "File Not Found"
When I go to "/safe-zone/my-wiki.html.wiki"
Then I should see "Safe"
When I go to "/safe-zone/my-wiki.html"
Then I should see "File Not Found"
When I go to "/textile-source.html.textile"
Then I should see "File Not Found"
When I go to "/textile-source.html"
Then I should see "File Not Found"
When I go to "/wiki-source.html.wiki"
Then I should see "Hola"
When I go to "/wiki-source.html"
Then I should see "File Not Found"

View File

@ -0,0 +1,2 @@
ignore "danger-zone/*"
ignore "*.textile"

View File

@ -75,6 +75,19 @@ module Middleman
app.register Middleman::Renderers::Stylus
rescue LoadError
end
# Clean up missing Tilt exts
app.after_configuration do
Tilt.mappings.each do |key, klasses|
begin
Tilt[".#{key}"]
rescue LoadError
Tilt.mappings.delete(key)
rescue NameError
Tilt.mappings.delete(key)
end
end
end
end
alias :included :registered