Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Few code cleanups

  • Loading branch information...
commit a0a07aa2bcdb563d382b0d0f5da408cfbb402111 1 parent 3da8e9b
@meh authored
View
6 lib/failirc/common/extensions.rb
@@ -385,3 +385,9 @@ def initialize (*args)
def_threaded :[], :[]=, :delete, :each, :each_value, :each_key
end
+
+class OpenSSL::SSL::SSLSocket
+ def method_missing (*args, &block)
+ to_io.__send__ *args, &block
+ end
+end
View
2  lib/failirc/server/dispatcher.rb
@@ -109,7 +109,7 @@ def clients
}.flatten
end
- def wakeup (options = {})
+ def wakeup (options={})
if options[:reset]
@clients = nil
@reset = true
View
10 lib/failirc/server/dispatcher/client.rb
@@ -59,15 +59,15 @@ def receive
@input.push(string)
}
rescue IOError
- disconnect 'Input/output error', :force => true
+ disconnect 'Input/output error'
rescue Errno::EBADF, Errno::EPIPE, OpenSSL::SSL::SSLError
- disconnect 'Client exited', :force => true
+ disconnect 'Client exited'
rescue Errno::ECONNRESET
- disconnect 'Connection reset by peer', :force => true
+ disconnect 'Connection reset by peer'
rescue Errno::ETIMEDOUT
- disconnect 'Ping timeout', :force => true
+ disconnect 'Ping timeout'
rescue Errno::EHOSTUNREACH
- disconnect 'No route to host', :force => true
+ disconnect 'No route to host'
rescue Exception => e
IRC.debug e
end
View
2  lib/failirc/server/modules/base/incoming.rb
@@ -24,7 +24,7 @@ module Incoming; def self.extended (obj)
@temporary = InsensitiveStruct.new
}
- obj.refine_method :send do |old, *args|
+ obj.refine_singleton_method :send do |old, *args|
if args.first.is_a?(String)
old.call(args.first)
else
View
7 lib/failirc/server/modules/shorten.rb
@@ -22,11 +22,8 @@
version '0.0.1'
class Shortie::Service
- class << self
- memoize :find_by_key
- end
-
- memoize :shorten
+ singleton_memoize :find_by_key
+ memoize :shorten
end
on :message, priority: -100 do |chain=:input, from, to, message|
Please sign in to comment.
Something went wrong with that request. Please try again.