Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/ripper/tools/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def to_s
if empty?
"rb_ary_new()"
else
"rb_ary_new_from_args(#{size}, #{map(&:to_s).join(', ')})"
values = map {|value| "(VALUE)0|(#{value})"}
"rb_ary_new_from_args(#{size}, #{values.join(', ')})"
end
end
end
Expand Down
10 changes: 8 additions & 2 deletions ext/socket/ancdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,14 @@ anc_inspect_passcred_credentials(int level, int type, VALUE data, VALUE ret)
}
#endif

#if defined(SCM_CREDS)
#define INSPECT_SCM_CREDS
#if !defined(SCM_CREDS)
#elif defined(HAVE_TYPE_STRUCT_CMSGCRED) /* FreeBSD */
# define INSPECT_SCM_CREDS
#elif defined(HAVE_TYPE_STRUCT_SOCKCRED) /* FreeBSD, NetBSD */
# define INSPECT_SCM_CREDS
#endif

#ifdef INSPECT_SCM_CREDS
static int
anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret)
{
Expand Down
5 changes: 0 additions & 5 deletions ext/socket/lib/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

require 'socket.so'

unless IO.method_defined?(:wait_writable, false)
# It's only required on older Rubies < v3.2:
require 'io/wait'
end

class Addrinfo
# creates an Addrinfo object from the arguments.
#
Expand Down
9 changes: 9 additions & 0 deletions test/ripper/test_ripper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,12 @@ def state(name)
Ripper::Lexer::State.new(Ripper.const_get(name))
end
end if ripper_test

class TestRipper::DSL < Test::Unit::TestCase
def test_array_elements_are_values
require_relative "../../ext/ripper/tools/dsl"

code = DSL.line?("/*% ripper: [$:$, 0] %*/").generate
assert_include(code, "rb_ary_new_from_args(2, (VALUE)0|(p->s_lvalue), (VALUE)0|(0))")
end
end if ripper_test
3 changes: 2 additions & 1 deletion test/rubygems/test_bundled_ca.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def assert_https(host)
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.cert_store = bundled_certificate_store
http.get("/")
rescue Errno::ENOENT, Errno::ETIMEDOUT, SocketError, Gem::Net::OpenTimeout
rescue Errno::ENOENT, Errno::ETIMEDOUT, Errno::ECONNRESET, Errno::ECONNREFUSED,
EOFError, SocketError, Gem::Net::OpenTimeout
pend "#{host} seems offline, I can't tell whether ssl would work."
rescue OpenSSL::SSL::SSLError => e
# Only fail for certificate verification errors
Expand Down