module Roda::RodaPlugins::MatchHook

  1. lib/roda/plugins/match_hook.rb

The match_hook plugin adds hooks that are called upon a successful match by any of the matchers.

plugin :match_hook

match_hook do
  logger.debug("#{request.matched_path} matched. #{request.remaining_path} remaining.")
end

Methods

Public Class

  1. configure

Public Class methods

configure(app)
[show source]
   # File lib/roda/plugins/match_hook.rb
15 def self.configure(app)
16   app.opts[:match_hooks] ||= []
17 end