Just give a example for my case.
I use pry for debug ruby code.
I need debug code in roda partial file occasionally.
so, i add `binding.pry` into partial file, but that not good, because binding.pry will
intercept may times per request, so, i have to use pry hack `!!!` to exit server, that
will cause SystemExit exception and make some server broken.
So, what i did to resolve this issue is: set a ENV varible for save global status,
and wrap `binding.pry` into a method, e.g. `pry!`, it works!
e..g when ENV['Pry_is_start'].nil?, pry! method will intercept. after first time pry!
is run, will set ENV['Pry_is_start'] = true, next time pry! is invoke, will just return
to ignore it.
Okay, following is my issue.
I have to set ENV['Pry_is_start'] back to nil somewhere when refresh page use new request, add `ENV['Pry_is_start'] = nil into uppermost of route block is work.
but, i don't want to change my project code just for this purpose.
so, is there exists a way to add a hook globally to Roda, when each time, new request is coming, some ruby code (e.g. set env) can be run?
Thank you.