Remove Tilt mappings for missing libraries. Fixes #713

This commit is contained in:
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 app.register Middleman::Renderers::Stylus
rescue LoadError rescue LoadError
end 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 end
alias :included :registered alias :included :registered