-
-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:automatic_directory_matcher optionally converts a character sequence…
… in file names into a subdirectory. Closes #491
- Loading branch information
Showing
11 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
middleman-core/features/automatic_directory_matcher.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Feature: Map special characters to automatically put files in a directory | ||
|
||
Scenario: Building files with special character escape | ||
Given a successfully built app at "automatic-directory-matcher-app" | ||
When I cd to "build" | ||
Then the following files should exist: | ||
| root.html | | ||
| root-plain.html | | ||
| sub/sub.html | | ||
| sub/sub-plain.html | | ||
| sub/sub/sub.html | | ||
| sub/sub/sub-plain.html | | ||
Then the following files should not exist: | ||
| sub--sub.html | | ||
| sub--sub-plain.html | | ||
| sub--sub--sub.html | | ||
| sub--sub--sub-plain.html | | ||
|
||
Scenario: Previewing files with special character escape | ||
Given the Server is running at "automatic-directory-matcher-app" | ||
When I go to "/root.html" | ||
Then I should see "Root Erb" | ||
When I go to "/root-plain.html" | ||
Then I should see "Root Plain" | ||
When I go to "/sub/sub.html" | ||
Then I should see "Sub1 Erb" | ||
When I go to "/sub/sub-plain.html" | ||
Then I should see "Sub1 Plain" | ||
When I go to "/sub/sub/sub.html" | ||
Then I should see "Sub2 Erb" | ||
When I go to "/sub/sub/sub-plain.html" | ||
Then I should see "Sub2 Plain" |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/config.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set :automatic_directory_matcher, "--" |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/source/root-plain.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Root Plain |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/source/root.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Root Erb |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/source/sub--sub--sub-plain.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sub2 Plain |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/source/sub--sub--sub.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sub2 Erb |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/source/sub--sub-plain.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sub1 Plain |
1 change: 1 addition & 0 deletions
1
middleman-core/fixtures/automatic-directory-matcher-app/source/sub--sub.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sub1 Erb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c3796a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty cool, but wouldn't it be more consistent to implement this as a Sitemap plugin?
c3796a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, it only effects when we load files off disk so it should probably be part of
OnDisk