rubinius/rubinius — pull request #2014 by frodsan (2012-11-14 06:19:15+00:00)
Title: Fix Socket#socketpair on X19.

Socket#socketpair `type` argument can accept
a symbol that references to a `Socket::SOCK_*`
constant.

require 'socket'

# Before

Socket.socketpair(Socket::PF_UNIX, Socket::SOCK_DGRAM, 0)
# => [#, #]

Socket.socketpair(Socket::PF_UNIX, :DGRAM, 0)
# => TypeError: Tried to use non-reference value 0x15a86 as type Bignum (10)

# After

Socket.socketpair(Socket::PF_UNIX, Socket::SOCK_DGRAM, 0)
# => [#, #]
Socket.socketpair(Socket::PF_UNIX, :DGRAM, 0)
# => [#, #]

Fixes #2011.