lib/jekyll/assets/hook.rb in jekyll-assets-3.0.5 vs lib/jekyll/assets/hook.rb in jekyll-assets-3.0.6

- old
+ new

@@ -1,7 +1,7 @@ # Frozen-string-literal: true -# Copyright: 2012 - 2017 - MIT License +# Copyright: 2012 - 2018 - MIT License # Encoding: utf-8 module Jekyll module Assets class Hook @@ -50,14 +50,38 @@ before_compile: { 1 => [], 2 => [], 3 => [], }, + + before_read: { + 1 => [], + 2 => [], + 3 => [], + }, + + after_read: { + 1 => [], + 2 => [], + 3 => [], + }, + + before_write: { + 1 => [], + 2 => [], + 3 => [], + }, + + after_write: { + 1 => [], + 2 => [], + 3 => [], + }, }, liquid: { - pre_render: { + before_render: { 1 => [], 2 => [], 3 => [], }, }, @@ -108,10 +132,14 @@ # @param [Proc{}] block the code to run. # @see self.add_point # @return [nil] # -- def self.trigger(*point, &block) - get_point(*point).map do |v| + hooks = get_point(*point) + Logger.debug "messaging hooks on #{point.last} " \ + "through #{point.first}" + + hooks.map do |v| block.call(v) end end # --