Skip to content

add glob support to include,exclude option#743

Merged
parkr merged 8 commits intojekyll:masterfrom
mccxj:master
Jan 13, 2013
Merged

add glob support to include,exclude option#743
parkr merged 8 commits intojekyll:masterfrom
mccxj:master

Conversation

@mccxj
Copy link
Copy Markdown
Contributor

@mccxj mccxj commented Jan 9, 2013

use File.fnmatch to glob match

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use Enumerable#any? here:

exps.any? { |exp| File.fnmatch?(exp, e) }

@mccxj
Copy link
Copy Markdown
Contributor Author

mccxj commented Jan 10, 2013

@ixti great idea! change code to use any? instead

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll have SyntaxError here. Remove closing bracket: }) -> }

@mccxj
Copy link
Copy Markdown
Contributor Author

mccxj commented Jan 10, 2013

sorry,i edit code with iPad. ^_^

@mattr-
Copy link
Copy Markdown
Member

mattr- commented Jan 10, 2013

👍 This looks fine to me. I believe it also fulfills @qrush's desire to use globs instead of regexps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this should be a core extension instead of randomly in Jekyll. Jekyll#glob_include? just feels weirder to me than Array#glob_include? or something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must admin it was my thought as well.
I think it should be Array#glob_include?.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My choose is Enumerable#glob_include?

@parkr
Copy link
Copy Markdown
Member

parkr commented Jan 11, 2013

Please consider making the changes as proposed in the diff. I'd be happy to merge if that change is made.

@ghost ghost assigned parkr Jan 12, 2013
@parkr
Copy link
Copy Markdown
Member

parkr commented Jan 13, 2013

Thanks for doing that. I am working on figuring out which test is failing, but Cucumber is proving fickle.

parkr added a commit that referenced this pull request Jan 13, 2013
add glob support to include, exclude option
@parkr parkr merged commit e383bfe into jekyll:master Jan 13, 2013
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants