Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tachiba/5520546 to your computer and use it in GitHub Desktop.
Save tachiba/5520546 to your computer and use it in GitHub Desktop.
monkeypatch for resolve-replace on ruby2.0.0p0
# SEE: http://www.ruby-forum.com/topic/4411796
class TCPSocket < IPSocket
def initialize(host, serv, *rest)
rest[0] = IPSocket.getaddress(rest[0]) if rest[0]
#rest[0] = IPSocket.getaddress(rest[0]) unless rest.empty?
original_resolv_initialize(IPSocket.getaddress(host), serv, *rest)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment