diff options
author | azul <azul@riseup.net> | 2017-09-23 15:11:20 +0000 |
---|---|---|
committer | azul <azul@riseup.net> | 2017-09-23 15:11:20 +0000 |
commit | fac140a8ff76e98c275194845125d4c97f4ba07b (patch) | |
tree | 08ffafb2c70935892e975704911080b9da84e391 /lib/nickserver/handler_chain.rb | |
parent | 787287318c54b019a12ef79525c9f5b10d93724d (diff) | |
parent | 8ac6bb8492c9a3b9ec5d7b5bf2b35907a1f8c332 (diff) |
Merge branch 'rubocop' into 'master'
Style fixes based on Rubocop
See merge request leap/nickserver!19
Diffstat (limited to 'lib/nickserver/handler_chain.rb')
-rw-r--r-- | lib/nickserver/handler_chain.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/nickserver/handler_chain.rb b/lib/nickserver/handler_chain.rb index afc24a5..f685a2e 100644 --- a/lib/nickserver/handler_chain.rb +++ b/lib/nickserver/handler_chain.rb @@ -1,3 +1,5 @@ +require 'English' + # # Handler Chain # @@ -14,7 +16,6 @@ module Nickserver class HandlerChain - def initialize(*handlers) @handlers = handlers @exceptions_to_rescue = [] @@ -27,7 +28,7 @@ module Nickserver def handle(*args) result = nil - _handled_by = @handlers.find{|h| result = try_handler(h, *args)} + _handled_by = @handlers.find { |h| result = try_handler(h, *args) } result end @@ -41,7 +42,7 @@ module Nickserver def try_handler(handler, *args) result = handler.call(*args) rescue *exceptions_to_rescue - self.rescued_exceptions << $! + rescued_exceptions << $ERROR_INFO result = false end end |