Ruby equivalent to a Java context Listener

Hi people,

Is there any Ruby equivalente to a Java Context Listener? So I can
execute some code and gather some data at the start of a Ruby container
and keep it on and accessible at any time and from everywhere in my
application?

TIA,
Thiago.