mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Remove Tilt mappings for missing libraries. Fixes #713
This commit is contained in:
parent
84239f04a2
commit
eccda125e5
7 changed files with 39 additions and 0 deletions
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
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue