Dest match #1556

merged 3 commits into from Sep 17, 2013


None yet

3 participants


As noted in #1130, jekyll's current matching of source and destination (to ensure that the source is not inside the destination) is too aggressive, meaning that a source of blog-source and a destination of blog will cause the generation to halt. This is because it uses a simple regex for checking.

This PR changes the relevant code to use Pathname instead, and also adds an extensive cucumber feature to test the behaviour. This fixes the described issue.

@parkr parkr commented on the diff Sep 16, 2013
@@ -83,6 +79,17 @@ def setup
self.generators = instantiate_subclasses(Jekyll::Generator)
+ # Check that the destination dir isn't the source dir or a directory
+ # parent to the source dir.
+ def ensure_not_in_dest
+ dest =
+ do |path|
parkr Sep 16, 2013 Member

How efficient is Pathname#ascend?

mattr- Sep 17, 2013 Member

as efficient as working with strings, since that's what most of Pathname does anyways.

@parkr parkr commented on the diff Sep 16, 2013
@@ -137,10 +137,14 @@
-Then /^the (.*) directory should exist$/ do |dir|
+Then /^the (.*) directory should +exist$/ do |dir|
parkr commented Sep 16, 2013

This looks pretty good to me! @mattr-?

Thanks @maul-esel!

@mattr- mattr- merged commit de49342 into jekyll:master Sep 17, 2013

1 check passed

default The Travis CI build passed
@mattr- mattr- added a commit that referenced this pull request Sep 17, 2013
@mattr- mattr- Update history to reflect merge of #1556 bff0f9e
@maul-esel maul-esel deleted the maul-esel:dest-match branch Sep 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment