From 1a05483a6304f59bff8d30f26f53ed7a51fa3ad9 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 18 May 2016 18:54:49 -0700 Subject: [PATCH 1/2] Sort the results of the require_all glob. Filesystems behave differently when performing glob listings. In my environment, they are listed alphabetically. On my Mac, when asking for a list of files in a directory, those files are returned as a nicely sorted list. Alphabetized, like you'd want them to be. Like you'd expect them to be. In some environments, quite different from my own, the return of a similar operation is quite random. Perhaps q comes before a, or e before d; the filesystem will choose its order of the day and you, the fare user, tired and weary from work, must bare the brunt of this. And so, with this commit, I do hereby request that the noble makers of Dir[] provide for us, the downtrodden and ravaged users, some consistency. As a user of Ruby, I shouldn't have to know or consider the behaviour of an individual filesystem here; it should function the same for all filesystems. Truly yours, Parker --- lib/jekyll.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index e9f4547b..16cedc68 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -7,7 +7,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is insta # Returns nothing. def require_all(path) glob = File.join(File.dirname(__FILE__), path, '*.rb') - Dir[glob].each do |f| + Dir[glob].sort.each do |f| require f end end From ad7bd8409810e361417b14ea7434a0fc12483f31 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 18 May 2016 21:11:14 -0700 Subject: [PATCH 2/2] lib/jekyll.rb: require document_drop to ease our pain --- lib/jekyll.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 16cedc68..9530b2d1 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -173,6 +173,7 @@ module Jekyll end require "jekyll/drops/drop" +require "jekyll/drops/document_drop" require_all 'jekyll/commands' require_all 'jekyll/converters' require_all 'jekyll/converters/markdown'