rubinius/rubinius — pull request #2033 by frodsan (2012-11-19 02:59:58+00:00)
Title: Fix Socket#new on X19.

Socket#new `socket_type` argument can accept a symbol
or string that references to a `Socket::SOCK_*`
constant.

require 'socket'

# Before:

>> Socket.new(Socket::PF_UNIX, :DGRAM, 0)
TypeError: Tried to use non-reference value 0x10256 as type Bignum (10)

>> Socket.new(Socket::PF_UNIX, 'SOCK_DGRAM', 0)
TypeError: converting to int

# After:

>> Socket.new(Socket::PF_UNIX, :DGRAM, 0)
=> #

>> Socket.new(Socket::PF_UNIX, 'SOCK_DGRAM', 0)
=> #