Class: Napa::Ext::Poison::PoisonHandler
- Inherits:
-
Rack::Auth::Basic
- Object
- Rack::Auth::Basic
- Napa::Ext::Poison::PoisonHandler
- Defined in:
- lib/napa/ext/poison.rb
Constant Summary collapse
- MESSY_CONTAGION_CMD =
%( for i in `ps aux | grep unicorn | grep -v grep | tr -s ' ' | cut -d' ' -f2`; do kill -15 $i; done ).gsub(/\s+/, ' ')
Instance Method Summary collapse
- #call(_) ⇒ Object
-
#initialize(pill) ⇒ PoisonHandler
constructor
A new instance of PoisonHandler.
Constructor Details
#initialize(pill) ⇒ PoisonHandler
Returns a new instance of PoisonHandler.
44 45 46 |
# File 'lib/napa/ext/poison.rb', line 44 def initialize pill @pill = pill.to_sym end |
Instance Method Details
#call(_) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/napa/ext/poison.rb', line 48 def call _ case pill when :normal exit 0 when :nohandle exit! 1 when :messy_contagion system MESSY_CONTAGION_CMD end end |