Module: Rack::TestServer::SignalTrapInterceptor
- Defined in:
- lib/rack/test_server/signal_trap_interceptor.rb
Class Method Summary collapse
Class Method Details
.disable ⇒ Object
15 16 17 |
# File 'lib/rack/test_server/signal_trap_interceptor.rb', line 15 def disable remove_method(:trap) end |
.enable ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/rack/test_server/signal_trap_interceptor.rb', line 5 def enable define_method(:trap) do |sig, &handler| if sig == :INT || sig == 'SIGINT' puts "[NOTE] `trap(#{sig})` is ignored called from #{caller_locations.first}" else super(sig, &handler) end end end |