Merge pull request #632 from bhollis/tilde

Fix handling directories with ~ in them.
This commit is contained in:
Thomas Reynolds 2012-10-11 10:07:37 -07:00
commit e5713f74d5
2 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,14 @@
@encoding
Feature: Tilde directories
In order to support ~ characters in directories
Scenario: Build directories with containing ~ characters in their name
Given a fixture app "empty-app"
And a file named "source/~notexistinguser/index.html" with:
"""
It works!
"""
And the Server is running
When I go to "/~notexistinguser/index.html"
Then I should see "It works!"

View file

@ -127,8 +127,7 @@ module Middleman::CoreExtensions
# @param [String] path
# @return [Array<Thor::CoreExt::HashWithIndifferentAccess, String>]
def frontmatter_and_content(path)
full_path = File.expand_path(path, @app.source_dir)
full_path = File.expand_path(File.join(@app.source_dir, path))
content = File.read(full_path)
data = {}