Remove Tilt mappings for missing libraries. Fixes #713
This commit is contained in:
parent
84239f04a2
commit
eccda125e5
20
middleman-core/features/missing-tilt-lib.feature
Normal file
20
middleman-core/features/missing-tilt-lib.feature
Normal 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"
|
|
@ -0,0 +1,2 @@
|
||||||
|
ignore "danger-zone/*"
|
||||||
|
ignore "*.textile"
|
|
@ -0,0 +1 @@
|
||||||
|
More
|
|
@ -0,0 +1 @@
|
||||||
|
Safe
|
|
@ -0,0 +1 @@
|
||||||
|
Textx
|
|
@ -0,0 +1 @@
|
||||||
|
Hola
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue