lib/jekyll/assets.rb in jekyll-assets-2.4.0 vs lib/jekyll/assets.rb in jekyll-assets-3.0.0
- old
+ new
@@ -1,19 +1,23 @@
# Frozen-string-literal: true
-# Copyright: 2012 - 2016 - MIT License
+# Copyright: 2012 - 2017 - MIT License
# Encoding: utf-8
-require "sprockets"
-require "extras/all"
require "pathutil"
require "jekyll"
-requires = [ :liquid,
- :patches, "", :hooks, :addons,
- :proxies, :processors]
+# --
+# rubocop:disable Layout/BlockEndNewline
+# rubocop:disable Layout/MultilineBlockLayout
+# rubocop:disable Style/BlockDelimiters
+# --
+def require_all(*globs)
+ path = Pathutil.new("assets").expand_path(__dir__)
+ globs.each { |v| path.glob(v).reject(&:directory?).each do |vv|
+ require vv
+ end }
+end
-requires.each do |part|
- Pathutil.new(__dir__).join('assets', part.to_s)
- .glob('{*,**/*}.rb').map(&method(
- :require
-))
+require_relative "assets/env"
+Jekyll::Hooks.register :site, :post_read do |o|
+ Jekyll::Assets::Env.new(o)
end