Skip to content

Commit

Permalink
register hooks reset callback at highest priority
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jul 4, 2016
1 parent 39979c3 commit ba9ca3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ module Jekyll
module Hooks; extend self
# deep dup hashes and shallow dup the leaves
def deep_dup h
h.each_with_object({}) {|(k, v), new_h| new_h[k] = ::Hash === v ? (deep_dup v) : v.dup }
h.each_with_object({}) {|(k, v), accum| accum[k] = ::Hash === v ? (deep_dup v) : v.dup }
end

def reset site
@registry = deep_dup @initial_registry
end

register :site, :after_reset, &(method :reset)
register :site, :after_reset, priority: :high, &(method :reset)
@initial_registry = deep_dup @registry
end
end if defined? Jekyll::Hooks
Expand Down

0 comments on commit ba9ca3b

Please sign in to comment.