Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean up globbed requires

  • Loading branch information...
commit 08bc63289dd0b68e1df36755ea8d8f33a2fc77de 1 parent 81971c3
@mojombo mojombo authored
Showing with 16 additions and 6 deletions.
  1. +16 −6 lib/jekyll.rb
View
22 lib/jekyll.rb
@@ -1,15 +1,25 @@
$:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
+# Require all of the Ruby files in the given directory.
+#
+# path - The String relative path from here to the directory.
+#
+# Returns nothing.
+def require_all(path)
+ glob = File.join(File.dirname(__FILE__), path, '*.rb')
+ Dir[glob].each do |f|
+ require f
+ end
+end
+
# rubygems
require 'rubygems'
-# core
+# stdlib
require 'fileutils'
require 'time'
require 'yaml'
-# stdlib
-
# 3rd party
require 'liquid'
require 'redcloth'
@@ -24,14 +34,14 @@
require 'jekyll/filters'
require 'jekyll/albino'
require 'jekyll/static_file'
-Dir[File.dirname(__FILE__) + "/jekyll/tags/*.rb"].each { |f| require f }
#extensions
require 'jekyll/extension'
require 'jekyll/converter'
require 'jekyll/generator'
-Dir[File.dirname(__FILE__) + "/jekyll/converters/*.rb"].each { |f| require f }
-Dir[File.dirname(__FILE__) + "/jekyll/generators/*.rb"].each { |f| require f }
+require_all 'jekyll/converters'
+require_all 'jekyll/generators'
+require_all 'jekyll/tags'
module Jekyll
# Default options. Overriden by values in _config.yml or command-line opts.
Please sign in to comment.
Something went wrong with that request. Please try again.